6 define(
"FEATURE_LIMIT_MAX_AMOUNT", 99999999.99 );
7 define(
"FEATURE_LIMIT_MAX_COUNT", 99999 );
12 define (
"HOMECU_CACERT_DIR",
"/home/homecu/ssl/ca-certficates/");
16 define (
"HOMECU_DOCK_CERT_DIR",
"/tmp/odyssey/");
20 define (
"HOMECU_ENC_CERT_DIR",
"/home/homecu/ssl/");
36 require_once
'logging.i';
49 function GetEnvSetting($envkey, $default=NULL) {
51 if (array_key_exists($envkey, $_ENV)) {
52 $value = $_ENV[$envkey];
53 if (is_numeric($value)) {
54 $value = (float) $value;
72 function LoadSystemEnv($pLoggerName) {
73 $logger = getLogger($pLoggerName, GetEnvSetting(
'DEVMODE', 0));
76 'devmode' => GetEnvSetting(
'DEVMODE', 0),
78 'host' => GetEnvSetting(
'DATABASE_HOST',
'localhost'),
79 'port' => GetEnvSetting(
'DATABASE_PORT', 5342),
80 'dbname' => GetEnvSetting(
'DATABASE_NAME',
'homecu_prod1'),
81 'user' => GetEnvSetting(
'DATABASE_USER',
'postgres'),
82 'password' => GetEnvSetting(
'DATABASE_PASSWORD'),
83 'connect_timeout' => GetEnvSetting(
'DATABASE_CONNECT_TIMEOUT'),
84 'platform' => GetEnvSetting(
'DATABASE_PLATFORM',
'postgres')
87 'domain' => GetEnvSetting(
'TICKET_DOMAIN',
'homecu.net'),
88 'expires' => GetEnvSetting(
'TICKET_EXPIRES', 900),
89 'persists' => GetEnvSetting(
'TICKET_PERSISTS', 94 * 86400),
90 'inactive' => GetEnvSetting(
'TICKET_INACTIVE', 1800)
92 'site_path' => GetEnvSetting(
'SITE_PATH',
'/var/www/site'),
93 'file_path' => GetEnvSetting(
'FILE_PATH',
'/home'),
94 'server_host' => GetEnvSetting(
'SERVER_HOST',
'localhost'),
95 'require_encryption' => GetEnvSetting(
'REQUIRE_ENCRYPTION', 1),
97 'ip_acl' => GetEnvSetting(
'ADMIN_IP_ACL',
'199.184.207.194;67.42.72.111')
107 if (substr_count($retVal[
'ticket'][
'domain'],
'.') > 1) {
117 $lastPos = strrpos($retVal[
'ticket'][
'domain'],
'.');
118 if ($lastPos !==
false) {
119 $secondLastPos = strrpos($retVal[
'ticket'][
'domain'],
'.', $lastPos - strlen($retVal[
'ticket'][
'domain']) - 1);
120 if ($secondLastPos !==
false) {
121 $retVal[
'ticket'][
'domain'] = substr($retVal[
'ticket'][
'domain'], $secondLastPos + 1);
129 function SetEnvStatic( &$pEnv ) {
131 $pEnv[
'defaultScript'] =
'hcuAccounts.prg';
133 $pEnv[
'homebanking_status'] = GetServerStatus();
135 $pEnv[
'secret'] = GetSecretKeyString();
136 $pEnv[
'2factorkey'] = Get2FactorKeyString();
138 $pEnv[
'historyHash'] = GetHistoryKeyString();
139 $pEnv[
'hcuViewNoticeKey'] = GetViewNoticeKey();
141 $pEnv[
'livePacketStatusCookie'] =
'_hlc';
143 $pEnv[
'cloudfrontDomainName'] = GetCloudFrontDomainName();
144 $pEnv[
'homecuKendoVersion'] = GetHomecuKendoVersion();
145 $pEnv[
'bootstrapVersion'] = GetHomecuBootstrapVersion();
146 $pEnv[
'fontawesomeVersion'] = GetFontawesomeVersion();
150 function GetDBH( $dbName ) {
151 $dbh = db_pconnect( $dbName ) ;
157 function SetLanguageEnv( &$pEnv ) {
162 $cookieName = $pEnv[
'cu'] .
'_lang';
163 if ( HCU_array_key_exists( $cookieName, $_COOKIE ) ) {
164 $pEnv[
'Flang'] = $_COOKIE[$cookieName];
166 $pEnv[
"Flang"] =
"en_US";
176 function GetSecretKeyString() {
177 return 'xogich6RFoogeid4';
185 function Get2FactorKeyString(){
186 return "Tu0geethSaith7ch";
197 function GetDeviceCookieContentString(){
198 return 'HomeCU_Home Banking for Credit Unions';
206 function GetHistoryKeyString() {
208 return '3I20kOxgojS8XDjyPi2vQXLs3m9m0Us9';
216 function GetViewNoticeKey() {
217 return 'EN!L(2cOYy4U|9o-2]Jc8X=G6h+sr3';
220 function GetServerStatus() {
239 function GetCloudFrontDomainName() {
240 return 'd1kryjpwpzirc7.cloudfront.net';
254 function GetHomecuKendoVersion ($pApp =
"default") {
258 $retVal =
"v2018.2.516";
261 $retVal =
"v2017.3.913";
271 function GetHomecuBootstrapVersion () {
279 function GetFontawesomeVersion () {
286 function GetTinyMCEVersion () {
294 function GetAdminDefaultKendoStyle() {
302 function GetMonitorDefaultKendoStyle() {
310 function GetOpenSSLKeyBilbo() {
312 return "VXVtbYOrbt5avJme6ihbeS9MznYMPe9a";
315 function GetOpenSSLKeyBugs() {
316 return "w0ki5QwpYWkM2FpitNEsosG9HGL9uogS";
319 function GetValidationKey() {
323 function GetPayloadGlue() {
336 function GetPayloadEncryptionKey($pKeySizeBytes = 32) {
337 $keyString =
"QtjWSJOtd02rKAm6xbxKipsRpXkUCuSf";
339 $pKeySizeBytes = intval( $pKeySizeBytes ) < 16 ? 16 : $pKeySizeBytes;
340 $pKeySizeBytes = intval( $pKeySizeBytes ) > strlen( $keyString ) ? strlen( $keyString ) : $pKeySizeBytes;
341 $appKey = substr( $keyString, 0, $pKeySizeBytes );
354 function GetCaptchaSiteKey() {
360 $retKey =
'6Ld5QyQUAAAAAB-irRU5xGHndWNtB31RDIWQ4nPE';
369 function GetCreditUnionKey() {
370 return '$¢®3d1tUn10nK3`/';
377 function GetCreditUnionCookie() {
387 function GetCaptchaSecret($pDomain=
'') {
389 $retKey =
"6Ld5QyQUAAAAAKIO8aPwhHSf9T2oAzj7KfyJxjj_";
401 function GetGPStatsCredentialsPath() {
402 return "test/secrets/homecu/google/gpstats/credentials.json";
409 function GetScriptDir() {
410 return "/opt/odyssey/tools/bin";
417 function GetCCConfig($home_path) {
418 return "$home_path/bin/ccardload.cfg";
425 function GetCCName() {
426 return "CREDIT CARD";
431 function BuildEnvironmentInfoCookie($pHBEnv, $pVersionCode) {
434 switch ($pVersionCode) {
436 $environment =
"Pegasus";
441 $environment =
"Odyssey";
445 $until = time() + $pHBEnv[
'SYSENV'][
'ticket'][
'expires'];
446 $hashedValue = sha1( $environment . $until . $pVersionCode . $pHBEnv[
"secret"] );
447 $profileCookie =
"env=$environment&version=$pVersionCode&until=$until&check=$hashedValue";
449 return "envinfo|$profileCookie|$until";
454 function VerifyEnvironmentInfoCookie($pHBEnv, $pEnvInfoCookie) {
456 if ( strlen( $pEnvInfoCookie ) == 0 ) {
461 parse_str( $pEnvInfoCookie, $testArr );
464 if ( $testArr[
'until'] < $now ) {
470 $hashedValue = sha1( $testArr[
'env'] . $testArr[
'until'] . $testArr[
'version'] . $pHBEnv[
"secret"] );
472 if ( $testArr[
'check'] != $hashedValue ) {
491 function LoadClientEnvInfo(&$pHBEnv, $pEnvInfoCookieString) {
492 if ( VerifyEnvironmentInfoCookie( $pHBEnv, $pEnvInfoCookieString) ) {
494 parse_str( $pEnvInfoCookieString, $valueArr );
496 $pHBEnv[
"envinfo"] = $valueArr[
"env"];
498 $pHBEnv[
"envinfo"] =
"Unknown";