Odyssey
admLogout.prg
1 <?php
2 # don't check for a cookie -- would be really silly to require a
3 # login before allowing logout.
4 
5 #
6 # Parse the variables to be used
7 #
8 
9 // Remove the banking cookie if initiated from BAM!
10 if (!empty($_COOKIE["Ticket"]))
11 {
12  $array= array();
13  parse_str($_COOKIE["Ticket"], $array);
14 
15  $Ca= trim(strtolower(HCU_array_key_value("Ca", $array)));
16  if ($Ca != "" && $Ca == trim(strtolower($Cn)))
17  HCU_setcookie_env($SYSENV, "Ticket", "", $now);
18 }
19 #
20 # record the cu-specific variables for web server logging
21 #
22 apache_note('user_name',"${Cu}:${Cn}");
23 
24 # set both the ticket cookie and the return-address cookie to null values
25 #
26 $now = time();
27 
28 HCU_setcookie_env($SYSENV, "aTicket", "", $now);
29 
30 HCU_setcookie_env($SYSENV, "Tx_aURI", "", $now);
31 
32 // ** look at credit union cookie to get cu product name
33 $creditUnionKey = '$¢®3d1tUn10nK3`/';
34 $creditUnionCookie = "_userc";
35 $cu = $Cu;
36 
37 if (HCU_array_key_exists($creditUnionCookie, $_COOKIE)) {
38  $creditUnion = $_COOKIE[$creditUnionCookie];
39  $creditUnionHash = $_COOKIE["${creditUnionCookie}Hash"];
40 
41  try
42  {
43  $cu = hcuOpenSSLDecrypt($creditUnion, $creditUnionHash, "NONE");
44  $cuMode = "inTicket";
45  }
46  catch(exception $e)
47  {
48  $SYSENV["logger"]->error("Credit Union cookie failed: " . $e->getMessage());
49  }
50 }
51 
52 // ** display credit union name here as well
53 $pName = checkOrgName($cu);
54 showProductName($pName);
55 $pName = ($pName == "" || $pName == "_") ? "HomeCU" : $pName;
56 
57 ?>
58 
59 <style>
60  #logoffForm {
61  width: 300px;
62  margin-left: auto;
63  margin-right: auto;
64  text-align: center;
65  }
66 </style>
67 <div class="container-fluid">
68  <div class="row-fluid">
69  <form id="logoffForm" method="post" action="<?php echo $self; ?>" role="form" data-role="validator" novalidate="novalidate">
70  <div class="well well-sm ">
71  <div class="form-horizontal form-widgets">
72  <?php printHeader("<b>ADMIN<br>LOG OFF</b>"); ?>
73  <div class="form-group">
74  <div class="col-xs-12">You have successfully logged off.</div>
75  </div>
76  <div class="form-group">
77  <div class="col-xs-12">Thank you for using <?php echo $pName; ?>.</div>
78  </div>
79  <div class="form-group">
80  <div class="col-xs-12"><a href="<?php echo $menu_link; ?>">Return to Admin.</a></div>
81  </div>
82  </div>
83  </div>
84  </form>
85  </div>
86  </div>