Temporary Registration Code

We sometimes need to give a user access to normally restricted functionality, either within ezFIT or ezHITConfig. Because of this we've adopted a scheme where we can give a user a code that will expire the next day. The code must be programmatically generated and is always an 8 digit hexadecimal string. You can generate a code for the user in 2 ways.

  1. Open the Tools > Options menu of ezFIT 5 with either the developer or QC codes entered.

The php used to generate a temporary code can be found below.

function CalcTempUnlockCode($date)
{
  $day_of_year = $date->format("z") + 1;
  $year = $date->format("Y");
 
  $temp_code_seed = md5($day_of_year . $year);
 
  $full_code = md5("TemporaryUnlock" . $temp_code_seed);
 
  return strtoupper(substr($full_code, 0, 8));
}