5 function ReturnAddress($pSysEnv)
8 HCU_setcookie_env($pSysEnv,
"Tx_aURI", $_SERVER[
'PHP_SELF'] .
"?" . urlencode($_SERVER[
'QUERY_STRING']), 0);
16 if (empty($_COOKIE[
'aTicket']))
17 throw new exception(
"No ticket", 1);
18 $ticket = $_COOKIE[
'aTicket'];
19 if ($SYSENV[
'require_encryption'] && !HCU_http_encrypted()) {
20 throw new exception(
"Something is wrong not referencing https", 2);
24 parse_str($ticket, $tarr);
26 if (isset($skip_time) ==
false || (isset($skip_time) ==
true and $skip_time ==
false))
29 if ($tarr[
'Ce'] < $now)
31 throw new exception(
"Ticket has expired", 3);
35 if (isset($cu) && $cu != $tarr[
'Cu'])
37 throw new exception(
"Different CU requested", 4);
40 if (is_null($tarr[
'Ch']) || is_null($tarr[
'Cn']) || is_null($tarr[
'Ctime']) || is_null($tarr[
'Ce']) || is_null($tarr[
'Cu']) || is_null($tarr[
'Cip']) || is_null($tarr[
'Cl']) ||
41 is_null($tarr[
'Cd']) || is_null($tarr[
'Clu']))
43 throw new exception(
"Partial ticket, try again", 5);
46 $secret =
'xogich6RFoogeid4';
47 if ($tarr[
'Ch'] != MD5($secret . MD5(join(
':', array($secret, $tarr[
'Cip'], $tarr[
'Ctime'], $tarr[
'Ce'], $tarr[
'Cl'], $tarr[
'Cu'], $tarr[
'Cn'], $tarr[
'Cd'], urlencode($tarr[
'Clu']),
48 urlencode($tarr[
'Fplog']), urlencode($tarr[
'Fflog']), $tarr[
'Ffchg'], $tarr[
'Ffremain'], $tarr[
'Fset'], $tarr[
'Fset2'], $tarr[
'Fset3'])))))
50 throw new exception(
"hash doesn't match, someone is hacking", 6);
58 if (isset($tarr[
"Cu"]) && isset($tarr[
"Cn"]))
60 apache_note(
'user_name',
"{$tarr['Cu']}:{$tarr['Cn']}");
62 if (!$result && $frm_login ==
false)
65 ReturnAddress($SYSENV);
66 header(
"Location: ${menu_link}?ft=71");
73 $expires = $Ctime + (array_key_exists(
'inactive', $SYSENV[
'ticket']) ? $SYSENV[
'ticket'][
'inactive'] : 600);
74 Set_aTicket($SYSENV, $_COOKIE[
'aTicket'],
"&Ctime=$Ctime&Ce=$expires");
76 $allowC = array(
'Ctime' =>
'Time',
'Ce' =>
'Expires',
'Cu' =>
'CU',
'Cn' =>
'Login Name',
'Clu' =>
'Last Update',
'Cip' =>
'IPaddr',
'Cd' =>
'DB',
'Cl' =>
'LiveBatch',
77 'Fplog' =>
'Last Login',
'Fflog' =>
'Failed Login',
'Ffchg' =>
'Force Change',
'Ffremain' =>
'Failed Remaining',
'Fset' =>
'Flagset 1',
'Fset2' =>
'Flagset 2',
'Fset3' =>
'Flagset 3');
78 extract(array_intersect_key($tarr, $allowC), EXTR_OVERWRITE);
80 $Clu = urldecode($Clu);
81 $Fflog = urldecode($Fflog);
82 $Fplog = urldecode($Fplog);