|
ZenCart_Documentation
1.5.0
http://www.collinsharper.com
|
00001 <?php 00009 if (!defined('IS_ADMIN_FLAG')) { 00010 die('Illegal Access'); 00011 } 00017 // customization for the design layout 00018 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125) 00019 00020 // Define how do we update currency exchange rates 00021 // Possible values are 'ecb', 'boc', 'oanda', 'xe', or '' (to disable the option). HOWEVER: Note that using "xe" or "oanda" subjects you to TOS terms requiring you to subscribe to their services. Use at your own risk. 00022 define('CURRENCY_SERVER_PRIMARY', 'ecb'); 00023 define('CURRENCY_SERVER_BACKUP', 'boc'); 00024 00025 // include the database functions 00026 require(DIR_WS_FUNCTIONS . 'database.php'); 00027 00028 // define our general functions used application-wide 00029 require(DIR_WS_FUNCTIONS . 'general.php'); 00030 require(DIR_WS_FUNCTIONS . 'functions_prices.php'); 00031 require(DIR_WS_FUNCTIONS . 'html_output.php'); 00032 require(DIR_WS_FUNCTIONS . 'functions_customers.php'); // partial copy of catalog functions customers for now 00033 require(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_email.php'); 00034 00038 require(DIR_WS_FUNCTIONS . 'functions_metatags.php'); 00039 00040 00041 // include the list of extra functions 00042 if ($za_dir = @dir(DIR_WS_FUNCTIONS . 'extra_functions')) { 00043 while ($zv_file = $za_dir->read()) { 00044 if (preg_match('/\.php$/', $zv_file) > 0) { 00045 require(DIR_WS_FUNCTIONS . 'extra_functions/' . $zv_file); 00046 } 00047 } 00048 $za_dir->close(); 00049 } 00050 if (isset($_GET) & sizeof($_GET) > 0 ) { 00051 foreach ($_GET as $key=>$value) { 00052 $_GET[$key] = strip_tags($value); 00053 } 00054 } 00055 00056 // check for SSL configuration changes: 00057 if (!defined('SSLPWSTATUSCHECK')) die('database upgrade required. please run the 1.3.9-to-1.5.0 upgrade via zc_install'); 00058 list($a, $b, $c) = explode(':', SSLPWSTATUSCHECK); $a = (int)$a; $b = (int)$b; $c = (int)$c; 00059 $d = (ENABLE_SSL_ADMIN == 'true') ? '1' : '0'; 00060 $e = (substr(HTTP_SERVER, 0, 5) == 'https') ? '1' : '0'; 00061 $f = ':'.$d.':'.$e; 00062 if ($a == 0) { 00063 if (($b == 0 && $d == 1) || ($c == 0 && $e == 1)) { 00064 $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '1" . $f . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'"; 00065 $db->Execute($sql); 00066 $sql = "UPDATE " . TABLE_ADMIN . " set pwd_last_change_date = '1990-01-01 14:02:22'"; 00067 $db->Execute($sql); 00068 } 00069 if (($b == 1 && $d == 0) || ($c == 1 && $e == 0)) { 00070 $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '0". $f . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'"; 00071 $db->Execute($sql); 00072 } 00073 } else if ($a == 1) { // == 1 00074 if (($b == 1 && $d == 0) || ($c == 1 && $e == 0)) { 00075 $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '0". $f . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'"; 00076 $db->Execute($sql); 00077 } 00078 if (($b == 0 && $d == 1) || ($c == 0 && $e == 1)) { 00079 $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '1" . $f . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'"; 00080 $db->Execute($sql); 00081 } 00082 } 00083 unset($a,$b,$c,$d,$e,$f); 00084 // end ssl config change detection