Odyssey
cu_top.i
1 <?php
2  header("Expires: Sat 20 May 1995 03:32:38 GMT");
3  header("Pragma: no-cache");
4  header("Cache-Control: no-cache, must-revalidate");
5 
6  $sharedLibrary= dirname(__FILE__) . "/../../shared/library";
7  $monLibrary= dirname(__FILE__) . "/../library";
8 
9  require_once("$sharedLibrary/logging.i");
10  require_once("$sharedLibrary/hcuEnv.i");
11  require_once("$sharedLibrary/hcuCommon.i");
12  require_once("$sharedLibrary/hcuFunctions.i");
13  require_once("$monLibrary/monitorFunctions.i");
14  require_once("$monLibrary/date_fun.i");
15  require_once("$monLibrary/cu_fun.i");
16  require_once("$sharedLibrary/hcuLogError.i");
17  require_once("$sharedLibrary/dms_imp_val.i");
18  require_once("$monLibrary/monitorView.i");
19  // ** Feature Gate support
20  require_once("$sharedLibrary/FeatureGateConfig.i");
21  require_once("$sharedLibrary/CreditUnionGate.i");
22 
23  if (HCU_array_key_exists("HTTP_ACCEPT_ENCODING", $_SERVER)) {
24  $useGZExt = (stristr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE ? ".jgz" : "");
25  }
26 
27  $SYSENV = LoadSystemEnv("monitor"); // From hcuEnv.i
28  /**
29  * Setup the error handling class
30  *
31  */
32  $errHndlr = new CatchErrorHandler(HCU_PRODUCT_MONITOR, $SYSENV['logger'], $SYSENV['devmode']);
33  $excHndlr = new CatchExceptionHandler(HCU_PRODUCT_MONITOR, $SYSENV['logger'], $SYSENV['devmode']);
34  $excHndlr->setErrorReporting($excHndlr->getErrorReporting() & ~E_WARNING);
35 
36  set_error_handler(array($errHndlr, "catchError"));
37  set_exception_handler(array($excHndlr, "catchException"));
38 
39  require("$sharedLibrary/db." . $SYSENV['db']['platform'] . ".i");
40 
41  $dbh = db_pconnect($SYSENV['db']); // Only call this once
42  $link = $dbh; // for backwards compatibility
43  if (!$dbh) { header("Location: /hcuadm/hcu_nodb.prg");exit; } // give error if db connect issues and die
44 
45  $dbhost = "localhost"; //reset later for prod with more intelligent switching
46 
47  // ** The purpose of this variable is [was] that infourl needs to point to barney [now and friends]
48  // * for testing purposes. But there are a few scripts on barney
49  // * ie combo_reports, stmnt_reports, and showflags
50  // * because the production scripts exist on barney, I want a variable
51  // * that will reference www4 and not cause any problems. This is that variable.
52  // * In the scripts previously mentioned they will use this instead of infourl
53  // ** PRODUCTION URL
54  // If scipts is on www4 - then set the produrl accordingly. Otherwise it should be the main monitor site
55 
56  // if $home_host = www4 or conceptvm, then build string:
57  // https://$home_host.homecu.net
58 
59  $server_name_and_port = strtolower($_SERVER['HTTP_HOST']);
60  $home_host = $server_name_and_port;
61 
62  // test for devmode via localhost and pass port in through sub-domain if so
63  $homecu_dot_net = ".homecu.net";
64  $dev_mode = false;
65  if (strpos($server_name_and_port, ".") !== false) {
66  $homecu_dot_net = ""; // periods present, assume DNS and blank out 'homecu.net' for static links
67  } elseif (strpos($server_name_and_port, "localhost") !== false) {
68  $homecu_dot_net = ":8000"; // assuming docker port will always be this? Need to ferret through hcuEnv.i see if it's in there somewhere
69  $dev_mode = true;
70  } elseif (strpos($server_name_and_port, "concept") !== false) {
71  $dev_mode = true;
72  }
73 
74  /**
75  * Determine if this is running on a production stack
76  * currently my.homecu.net is the only production stack
77  * homecu.io stacks should not be considered production stacks
78  */
79  $prodStack = false;
80  if (strpos($server_name_and_port, ".homecu.net") !== false) {
81  $prodStack = true;
82  }
83 
84 
85  if (!isset($lEnvSet)) { $lEnvSet = -1; } // check if $lEnvSet is null, and make it not if so
86 
87  $https_or_http = (HCU_array_key_value('require_encryption', $lEnvSet) == 0 && ($_SERVER['REQUEST_SCHEME'] != 'https' && getenv('HTTP_X_FORWARDED_PROTO') != 'https') ? 'http' : 'https');
88 
89  $produrl = $https_or_http."://".$server_name_and_port;
90  $infourl = $produrl; // for compatibility
91 
92  // ** SERVER LOCATION OF MAIN SCRIPTS --- This will be MORK later on
93  $menu_link = $infourl."/hcuadm";
94 
95  // get any passed variables
96  $dms_ok = array( "user_name"=>"string", "cu_name"=>"string" );
97  dms_import_v2($importVar, 'HCUPOST', $dms_ok);
98  $user_name = HCU_array_key_value('user_name', $importVar['HCUPOST']);
99 
100 
101 
102  // Create an array for the available types of companies to list
103  // Adjust this list to add/remove other on-line cu providers
104  $cu_prov_list = array ("(none)", "AFTECH", "CAVION", "CAVION 2Factor", "CGI",
105  "CMC FLEX", "COMMERCIAL BUSINESS", "COMPUSHARE", "Compusource",
106  "COMPUTER CONSULTANTS", "CU SOLUTIONS", "CU@home CUSO", "CUC LIVE", "CUSA",
107  "CUOL", "CUSO", "CYBERBRANCH", "Datamatic Live", "Digital Insight", "EDS",
108  "EPL", "ESP", "FEDCOMP", "FISERV", "FISERV Summit", "Funds Xpress", "GALAXY",
109  "HARLAND FINANCIAL", "INHOUSE", "LIBERTY", "Liberty Cavion", "NetZee", "NILCO",
110  "OPEN SOLUTIONS", "ORCC", "PREMIER SYSTEMS", "RC OLMSTEAD", "SELF", "SHARE ONE",
111  "Sharetec Live", "SO SYSTEMS", "SYMITAR", "ULTRADATA", "Unknown",
112  "USERS", "VIFI", "WWIS");
113 
114  // List the available types of cu contacts
115  $cu_contact_role = array ("05_CEO"=>"Ceo/Mgr",
116  "10_WEB"=>"Web Contact",
117  "15_IT"=>"IT Person",
118  "20_MKT"=>"Marketing",
119  "25_CU"=>"Credit Union",
120  "30_FAX"=>"Fax Line",
121  "35_EVE"=>"Evening/Night",
122  "40_REF"=>"HB Reference");
123 
124  // ** Constants for System Type Options
125  $SYS_TYPE_BATCH = 1;
126  $SYS_TYPE_LIVE = 2;
127  $SYS_TYPE_ASP = 4;
128  $SYS_TYPE_IVR = 8;
129  $SYS_TYPE_WEBONLY = 16;
130  $SYS_TYPE_UPGRADE = 32;
131  $SYS_TYPE_CLOSED = 64;
132  $SYS_TYPE_VOIP = 1024;
133 
134  // ** Add options for tracking HomeBanking Upgrade status
135  $SYS_TYPE_UPG_TEST = 128; // ** TESTING/SETUP
136  $SYS_TYPE_UPG_BETA = 256; // ** BETA - Use Legacy and Upgrade
137  $SYS_TYPE_UPG_COMP = 512; // ** Complete - They are LIVE with the new version ONLY
138 
139  // ** Monitor Upgrade include Settings
140  $cloudfrontDomainName = GetCloudFrontDomainName();
141  $homecuKendoVersion = GetHomecuKendoVersion("monitor");
142  $bootstrapVersion = GetHomecuBootstrapVersion();
143  $fontawesomeVersion = GetFontawesomeVersion();
144  $tinyMceVersion = GetTinyMCEVersion ();
145 
146  // Custom content
147  $skeletonLocation= "/home/homecu/skeleton";
148  $exportLocation= "/home/homecu/public_html/bankingIncludes";
149  $fragMntcFileLocation = "/home/$user_name/public_html/";
150  $fragBasePath = "/home/$user_name/public_html/";
151 
152  $logger= $SYSENV["logger"];