Odyssey
hcuLogout.prg
1 <?php
2  /*
3  * File: hcuLogout
4  *
5  * Purpose: This script should clear the session cookies for the current session.
6  * it may also need to show possible 'marketing' type information
7  * OR redirect to the home page, or just give a message
8  *
9  *
10  */
11 
12  // ** SET SCRIPT LEVEL VARIABLE
13 
14  // ** INCLUDE MAIN GLOBAL SCRIPT -- Handles security / global variable values
15  $serviceSkipCredentials = true;
16  $serviceSkipSecurity = true;
17  $serviceShowInfo = false;
18  $serviceLoadMenu = false;
19  $serviceAllowReadonly = true;
20 
21  require_once(dirname(__FILE__) . '/../library/hcuService.i');
22 
23 
24  // ** IMPORT Variables from form
25  $dmsValuesList = array('cu'=>'string', 'timedout'=>'string');
26 
27  dms_import_v2($HB_ENV, 'HCUPOST', $dmsValuesList);
28 
29 
30 
31  // ** DELETE SESSION COOKIE **
32  $ago = time() - 3600;
33 
34  HCU_setcookie_env($HB_ENV['SYSENV'], "Ticket", "", $ago);
35  HCU_setcookie_env($HB_ENV['SYSENV'], "Tx_URI", "", $ago);
36  HCU_setcookie_env($HB_ENV['SYSENV'], $HB_ENV['livePacketStatusCookie'], "", $ago);
37 
38  // see if going elsewhere based on how the footer logout url was configured
39  $logoutData = HCU_JsonDecode(HCU_array_key_value("Logout", $cuSettings));
40 
41  // ** INCLUDE PRE CONTENT SCRIPT
42  require_once(dirname(__FILE__) . '/../includes/hcuPreContent.i');
43 
44  if (HCU_array_key_value("url", $logoutData) != '') {
45  if ( !strlen( $HB_ENV["HCUPOST"]["timedout"] ) && strlen( $logoutData['url'] ) ) {
46  print <<<EOF
47  <script>
48  {
49  location.href = "{$logoutData['url']}";
50  }
51  </script>
52 EOF;
53  }
54  }
55 
56  /*
57  * RETRIEVE the content for this page, if it exists. NOTE: Never a popup.
58  *
59  */
60  $formsContentAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, "D", "LogoutScreen", true);
61 
62  $displayContent = "";
63  if ( $formsContentAry["status"]["code"] == "000" && $formsContentAry["notice"][0]["notice_id"] ) {
64  $displayContent = $formsContentAry['notice'][0]["notice_text"];
65  }
66 
67  if ( $displayContent == "" ) {
68  $displayContent = <<< EOF
69  <div id="form-content" class="container-fluid">
70  <div class="col-xs-12">
71  <h3>{$MC->msg("MEMBER LOGOFF", HCU_DISPLAY_AS_HTML)}</h3>
72  <div class='well well-sm well-bg-white' style="text-align:center;">
73  <div style="padding:10px">
74  <p>
75  {$MC->combo_msg("Logout", HCU_DISPLAY_AS_HTML, "#PNAME#", $HB_ENV['pname'])}
76  </p>
77  <p>
78  {$MC->msg('successful logoff', HCU_DISPLAY_AS_HTML)}
79  </p>
80  <p>
81  {$MC->msg('Would you like to', HCU_DISPLAY_AS_HTML)}: <a href='{$HB_ENV["loginscript"]}?{$HB_ENV["cuquery"]}'>{$MC->msg('Return To Home Banking', HCU_DISPLAY_AS_HTML)}</a>?
82  </p>
83  </div>
84  </div>
85  </div>
86  </div>
87  <style>
88  #form-content div p { padding:10px; }
89  </style>
90 EOF;
91  }
92 ?>
93  <div class="k-content" style='font-size:12px;'>
94 
95  <?php echo $displayContent; ?>
96 
97  </div>
98  <style>
99  </style>
100 
101  <script>
102 
103  $(document).ready(function() {
104  });
105  </script>
106 
107 
108 <?php
109  // ** INCLUDE POST CONTENT SCRIPT
110  require_once(dirname(__FILE__) . '/../includes/hcuPostContent.i');