8 $string = array(
"filter" => HCUFILTER_INPUT_STRING);
9 HCU_ImportVars($parameters,
"a", array(
"payload" => $string));
10 extract($parameters[
"a"]);
12 $operation = is_null($operation) ?
"" : trim($operation);
14 $userRecord = array();
16 $userRecord = HCU_PayloadDecode($Cu, $payload);
17 }
catch(exception $e) {
18 print
"No User Found";
25 $isMasterUser = $Cn === strtolower(trim($Cu));
26 $preventAccess = !$isMasterUser && HCU_array_key_value(
"employee", $userRecord) ===
"Y";
28 print
"You do not have access to view employee's account.";
32 $results = createTheCookie($dbh, $Cu, $Cn, intval($userRecord[
"user_id"]), intval($MEM_FORCE_RESET), $SYSENV);
34 if ($results[
"code"] != 0) {
35 print $results[
"error"][0];
37 header(
"location: $http_scheme://" . $_SERVER[
"HTTP_HOST"] .
"/banking/hcuAccounts.prg?cu=$Cu");
51 function createTheCookie ($dbh, $Cu, $Cn, $userId, $forceReset, $SYSENV) {
53 $sql =
"select failedremain, livewait, lastupdate, lastlogin, showavailable, forcechange, forceremain, trim(a.user_name), 54 userflags & $forceReset, failedlogin, pwchange, msg_tx, flagset, flagset2, flagset3, email,histdays,livebatch from ${Cu}user a, cuadmin b 55 where a.user_id = $userId and b.cu = '$Cu'";
56 $sth = db_query($sql, $dbh);
58 throw new exception(
"select query failed!", 1);
60 if (!list($failedremain, $livewait, $lastupdate, $llog, $showavail, $fchange, $fremain, $username, $freset, $flog, $pchange, $msgTx, $flagset, $flagset2,
61 $flagset3, $email, $histdays, $livebatch)= db_fetch_array($sth,0)) {
62 throw new exception(
"select query failed!", 2);
65 $failedremain = (is_null($failedremain) ? 5 : $failedremain);
66 $fremain = (is_null($fremain) ? 5 : $fremain);
67 $fchange = (is_null($fchange) ?
'N' : $fchange);
69 $livewait = (is_null($livewait) ?
"300" : $livewait);
70 $lastupdate = (trim(
"$lastupdate") ==
"" ?
"Unknown" : urlencode(trim($lastupdate)));
71 $llog = (trim(
"$llog") ==
"" ?
"None" : urlencode(trim($llog)));
72 $flog = (trim(
"$flog") ==
"" ?
"None" : urlencode(trim($flog)));
73 $msgTx = (is_null($msgTx) ? 0 : $msgTx);
74 $flagset = (is_null($flagset) ? 0 : $flagset);
75 $flagset2 = (is_null($flagset2) ? 0 : $flagset2);
76 $flagset3 = (is_null($flagset3) ? 0 : $flagset3);
77 $showavail = (is_null($showavail) ?
"_" : strtoupper(rtrim($showavail)));
78 $pchange = (is_null($pchange) ?
'01/01/2001 01:01:01' : $pchange);
79 $email = (is_null($email) ?
"_" : urlencode(rtrim($email)));
80 $fhdays = (is_null($histdays) ? 0 : $histdays);
82 $expires = $now + $SYSENV[
'ticket'][
'expires'];
83 $testmenu = (isset($testmenu) ? intval($testmenu) : 0);
84 $sid = strval(time());
86 HCU_setcookie_env($SYSENV,
"${Cu}_lang",
"en_US");
88 $mycookie =
"Ctime=$now&Cu=$Cu&Cn=$username&Uid=$userId&Ce=$expires&Clw=$livewait&Clu=$lastupdate&Fplog=$llog&Fflog=$flog&Ffchg=$fchange&Ffreset=$freset" 89 .
"&Ffremain=$fremain&Fmsg_tx=$msgTx&Fset=$flagset&Fset2=$flagset2&Fhdays=$fhdays&Ml=$email&Fset3=$flagset3&Ca=$Cn&platform=DSK&sid=$sid";
91 SetTicket(array(
"secret" => GetSecretKeyString(),
"SYSENV" => $SYSENV),
"", $mycookie);
92 }
catch(exception $e) {
93 return array(
"error" => array($e->getMessage()),
"code" => $e->getCode());
95 return array(
"error" => array(),
"code" => 0);