Odyssey
hcuWebView.prg
1 <?php
2 
3 /*
4 x is an json array encrypted and encoded.
5 docValues should now have 3 values
6  docsid - the docsid to lookup in the tables
7  Cu - the credit union code
8  device - the device that was used to call the function originally
9  chome - the cu code used in the file system
10  Flang - The language for the notice to retrieve
11  noticeOnly - {0, 1} If the value is NOT defined or 0, then it will show the
12  * html header wrapper around the notice. If the value is 1, then
13  * ONLY the message will be returned without any of the html wrapper
14  * ( this was added to allow hcuWebView to return a notice where the contents
15  * can be directly inserted into a div type window overlay )
16  */
17 // ** SET SCRIPT LEVEL VARIABLES
18 $serviceShowInfo = false;
19 $serviceLoadMenu = false;
20 $serviceShowMenu = false;
21 $serviceAllowReadonly = true;
22 $serviceSkipSecurity = true;
23 $serviceSkipCredentials = true;
24 
25 // ** INCLUDE MAIN GLOBAL SCRIPT -- Handles security / global variable values
26 require_once(dirname(__FILE__) . '/../library/hcuService.i');
27 
28 $dms_ok=array('x'=>'string');
29 dms_import_v2($HB_ENV, 'HCUPOST', $dms_ok);
30 
31 $docValues= HCU_PayloadDecode($HB_ENV['Cu'], $HB_ENV['HCUPOST']['x']);
32 
33 $Cu = preg_replace("/[^A-Za-z0-9]/","",$docValues['Cu']);
34 $Cu = substr($Cu,0,10);
35 
36 $noticeary = Get_NoticeInfo($dbh, array('Cu'=>$HB_ENV['Cu'], 'chome'=>$docValues['chome'], 'Flang' => $docValues['Flang']), $MC, $docValues['device'],'viewcms','1',$docValues['docsid']);
37 
38 $notice_text = $noticeary['notice'][0]['notice_text'];
39 $notice_title = $noticeary['notice'][0]['notice_title'];
40 
41 # ADD CHECK FOR MATCHIN CU TO AVOID MISMATCHED ACCESS
42 if($Cu != $HB_ENV['Cu'] || empty($notice_text)) {
43  $notice_text = "<H1>Not Found</H1>
44  The requested file was not found on this server<P>
45  <HR>
46  <ADDRESS>{$_SERVER['SERVER_SIGNATURE']}</ADDRESS>";
47  $notice_title = "404 Not Found";
48 }
49 
50 if (HCU_array_key_exists("noticeOnly", $docValues) && $docValues['noticeOnly'] == 1) {
51  // ** ONLY print the notice
52  print $notice_text;
53 } else {
54  // ** this is the default. Print the html wrappers
55  print <<< EOF
56  <?xml version="1.0"?><!DOCTYPE html>
57  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
58  <head>
59  <title>{$notice_title}</title>
60  <meta charset="ISO-8859-1"/>
61  <meta name="robots" content="noindex,nofollow" />
62  <meta http-equiv="X-UA-Compatible" content="IE=8" />
63  </head>
64  <body>
65  <div id='ViewContent'>
66  {$notice_text}
67  </div>
68  </body>
69  </html>
70 EOF;
71 
72 
73 }