testmodus / includes / application_top.php
Historie | Anzeigen | Annotieren | Download (13 KB)
| 1 |
<?php
|
|---|---|
| 2 |
/* -----------------------------------------------------------------------------------------
|
| 3 |
$Id: application_top.php 13492 2021-04-01 10:57:43Z GTB $
|
| 4 |
|
| 5 |
modified eCommerce Shopsoftware
|
| 6 |
http://www.modified-shop.org
|
| 7 |
|
| 8 |
Copyright (c) 2009 - 2013 [www.modified-shop.org]
|
| 9 |
-----------------------------------------------------------------------------------------
|
| 10 |
based on:
|
| 11 |
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
|
| 12 |
(c) 2002-2003 osCommerce(application_top.php,v 1.273 2003/05/19); www.oscommerce.com
|
| 13 |
(c) 2003 nextcommerce (application_top.php,v 1.54 2003/08/25); www.nextcommerce.org
|
| 14 |
(c) 2006 XT-Commerce (application_top.php 1194 2010-08-22)
|
| 15 |
|
| 16 |
Released under the GNU General Public License
|
| 17 |
-----------------------------------------------------------------------------------------
|
| 18 |
Third Party contribution:
|
| 19 |
Add A Quickie v1.0 Autor Harald Ponce de Leon
|
| 20 |
|
| 21 |
Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
|
| 22 |
http://www.oscommerce.com/community/contributions,282
|
| 23 |
Copyright (c) Strider | Strider@oscworks.com
|
| 24 |
Copyright (c) Nick Stanko of UkiDev.com, nick@ukidev.com
|
| 25 |
Copyright (c) Andre ambidex@gmx.net
|
| 26 |
Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org
|
| 27 |
|
| 28 |
Released under the GNU General Public License
|
| 29 |
---------------------------------------------------------------------------------------*/
|
| 30 |
|
| 31 |
// xss secure
|
| 32 |
if (is_file('includes/xss_secure.php')) { |
| 33 |
include_once ('includes/xss_secure.php'); |
| 34 |
} |
| 35 |
|
| 36 |
# TESTMODUS
|
| 37 |
if (file_exists('includes/extra/testmodus/testmodus.php')) |
| 38 |
require_once('includes/extra/testmodus/testmodus.php'); |
| 39 |
|
| 40 |
// start the timer for the page parse time log
|
| 41 |
define('PAGE_PARSE_START_TIME', microtime(true)); |
| 42 |
|
| 43 |
// set the level of error reporting
|
| 44 |
@ini_set('display_errors', false); |
| 45 |
error_reporting(0); |
| 46 |
|
| 47 |
// configuration parameters
|
| 48 |
if (file_exists('includes/local/configure.php')) { |
| 49 |
include_once ('includes/local/configure.php'); |
| 50 |
} else {
|
| 51 |
include_once ('includes/configure.php'); |
| 52 |
} |
| 53 |
|
| 54 |
// call Installer
|
| 55 |
if ((DB_DATABASE == '' || !defined('DB_MYSQL_TYPE')) && is_dir('./_installer')) { |
| 56 |
header("Location: ./_installer"); |
| 57 |
exit();
|
| 58 |
} |
| 59 |
|
| 60 |
// minimum requirement
|
| 61 |
if (version_compare(PHP_VERSION, '5.6', '<')) { |
| 62 |
die('<h1>Minimum requirement PHP Version 5.6</h1>'); |
| 63 |
} |
| 64 |
|
| 65 |
// default time zone
|
| 66 |
date_default_timezone_set('Europe/Berlin');
|
| 67 |
|
| 68 |
// new error handling
|
| 69 |
if (is_file(DIR_WS_INCLUDES.'error_reporting.php')) { |
| 70 |
require_once (DIR_WS_INCLUDES.'error_reporting.php'); |
| 71 |
} |
| 72 |
|
| 73 |
// security inputfilter for GET/POST/COOKIE
|
| 74 |
require_once (DIR_FS_INC.'html_encoding.php'); |
| 75 |
require_once (DIR_WS_CLASSES.'class.inputfilter.php'); |
| 76 |
$InputFilter = new InputFilter(); |
| 77 |
|
| 78 |
$_GET = $InputFilter->process($_GET); |
| 79 |
$_POST = $InputFilter->process($_POST); |
| 80 |
$_REQUEST = $InputFilter->process($_REQUEST); |
| 81 |
$_GET = $InputFilter->safeSQL($_GET); |
| 82 |
$_POST = $InputFilter->safeSQL($_POST); |
| 83 |
$_REQUEST = $InputFilter->safeSQL($_REQUEST); |
| 84 |
|
| 85 |
// auto include
|
| 86 |
require_once (DIR_FS_INC . 'auto_include.inc.php'); |
| 87 |
|
| 88 |
// include the list of project filenames
|
| 89 |
require_once (DIR_WS_INCLUDES.'filenames.php'); |
| 90 |
|
| 91 |
// Debug-Log-Class - thx to franky
|
| 92 |
include_once (DIR_WS_CLASSES.'class.debug.php'); |
| 93 |
$log = new debug; |
| 94 |
|
| 95 |
// project version
|
| 96 |
define('PROJECT_VERSION', 'modified eCommerce Shopsoftware'); |
| 97 |
|
| 98 |
define('TAX_DECIMAL_PLACES', 0); |
| 99 |
|
| 100 |
// set the type of request (secure or not)
|
| 101 |
if (file_exists(DIR_WS_INCLUDES.'request_type.php')) { |
| 102 |
include_once (DIR_WS_INCLUDES.'request_type.php'); |
| 103 |
} else {
|
| 104 |
$request_type = 'NONSSL'; |
| 105 |
} |
| 106 |
|
| 107 |
// Base/PHP_SELF/SSL-PROXY
|
| 108 |
require_once (DIR_FS_INC . 'set_php_self.inc.php'); |
| 109 |
$PHP_SELF = set_php_self();
|
| 110 |
|
| 111 |
// list of project database tables
|
| 112 |
require_once (DIR_WS_INCLUDES.'database_tables.php'); |
| 113 |
|
| 114 |
// graduated prices model or products assigned ?
|
| 115 |
define('GRADUATED_ASSIGN', 'true'); |
| 116 |
|
| 117 |
// Database
|
| 118 |
require_once (DIR_FS_INC.'db_functions_'.DB_MYSQL_TYPE.'.inc.php'); |
| 119 |
require_once (DIR_FS_INC.'db_functions.inc.php'); |
| 120 |
|
| 121 |
// html basics
|
| 122 |
require_once (DIR_FS_INC.'xtc_href_link.inc.php'); |
| 123 |
require_once (DIR_FS_INC.'xtc_php_mail.inc.php'); |
| 124 |
|
| 125 |
require_once (DIR_FS_INC.'xtc_product_link.inc.php'); |
| 126 |
require_once (DIR_FS_INC.'xtc_category_link.inc.php'); |
| 127 |
require_once (DIR_FS_INC.'xtc_manufacturer_link.inc.php'); |
| 128 |
|
| 129 |
// html functions
|
| 130 |
require_once (DIR_FS_INC.'xtc_draw_checkbox_field.inc.php'); |
| 131 |
require_once (DIR_FS_INC.'xtc_draw_form.inc.php'); |
| 132 |
require_once (DIR_FS_INC.'xtc_draw_hidden_field.inc.php'); |
| 133 |
require_once (DIR_FS_INC.'xtc_draw_input_field.inc.php'); |
| 134 |
require_once (DIR_FS_INC.'xtc_draw_password_field.inc.php'); |
| 135 |
require_once (DIR_FS_INC.'xtc_draw_pull_down_menu.inc.php'); |
| 136 |
require_once (DIR_FS_INC.'xtc_draw_radio_field.inc.php'); |
| 137 |
require_once (DIR_FS_INC.'xtc_draw_selection_field.inc.php'); |
| 138 |
require_once (DIR_FS_INC.'xtc_draw_separator.inc.php'); |
| 139 |
require_once (DIR_FS_INC.'xtc_draw_textarea_field.inc.php'); |
| 140 |
require_once (DIR_FS_INC.'xtc_image_button.inc.php'); |
| 141 |
require_once (DIR_FS_INC.'xtc_image_submit.inc.php'); |
| 142 |
|
| 143 |
require_once (DIR_FS_INC.'xtc_not_null.inc.php'); |
| 144 |
require_once (DIR_FS_INC.'xtc_update_whos_online.inc.php'); |
| 145 |
require_once (DIR_FS_INC.'xtc_activate_banners.inc.php'); |
| 146 |
require_once (DIR_FS_INC.'xtc_expire_banners.inc.php'); |
| 147 |
require_once (DIR_FS_INC.'xtc_expire_specials.inc.php'); |
| 148 |
require_once (DIR_FS_INC.'xtc_parse_category_path.inc.php'); |
| 149 |
require_once (DIR_FS_INC.'xtc_get_product_path.inc.php'); |
| 150 |
require_once (DIR_FS_INC.'xtc_get_top_level_domain.inc.php'); |
| 151 |
require_once (DIR_FS_INC.'xtc_get_category_path.inc.php'); |
| 152 |
require_once (DIR_FS_INC.'xtc_get_content_path.inc.php'); |
| 153 |
|
| 154 |
require_once (DIR_FS_INC.'xtc_get_parent_categories.inc.php'); |
| 155 |
require_once (DIR_FS_INC.'xtc_redirect.inc.php'); |
| 156 |
require_once (DIR_FS_INC.'xtc_get_uprid.inc.php'); |
| 157 |
require_once (DIR_FS_INC.'xtc_get_all_get_params.inc.php'); |
| 158 |
require_once (DIR_FS_INC.'xtc_has_product_attributes.inc.php'); |
| 159 |
require_once (DIR_FS_INC.'xtc_image.inc.php'); |
| 160 |
require_once (DIR_FS_INC.'xtc_check_stock.inc.php'); |
| 161 |
require_once (DIR_FS_INC.'xtc_check_stock_attributes.inc.php'); |
| 162 |
require_once (DIR_FS_INC.'xtc_currency_exists.inc.php'); |
| 163 |
require_once (DIR_FS_INC.'xtc_remove_non_numeric.inc.php'); |
| 164 |
require_once (DIR_FS_INC.'xtc_get_ip_address.inc.php'); |
| 165 |
require_once (DIR_FS_INC.'xtc_setcookie.inc.php'); |
| 166 |
require_once (DIR_FS_INC.'xtc_check_agent.inc.php'); |
| 167 |
require_once (DIR_FS_INC.'xtc_count_cart.inc.php'); |
| 168 |
require_once (DIR_FS_INC.'xtc_get_qty.inc.php'); |
| 169 |
require_once (DIR_FS_INC.'create_coupon_code.inc.php'); |
| 170 |
require_once (DIR_FS_INC.'xtc_gv_account_update.inc.php'); |
| 171 |
require_once (DIR_FS_INC.'xtc_get_tax_rate_from_desc.inc.php'); |
| 172 |
require_once (DIR_FS_INC.'xtc_get_tax_rate.inc.php'); |
| 173 |
require_once (DIR_FS_INC.'xtc_add_tax.inc.php'); |
| 174 |
require_once (DIR_FS_INC.'xtc_cleanName.inc.php'); |
| 175 |
require_once (DIR_FS_INC.'xtc_calculate_tax.inc.php'); |
| 176 |
require_once (DIR_FS_INC.'xtc_input_validation.inc.php'); |
| 177 |
require_once (DIR_FS_INC.'xtc_js_lang.php'); |
| 178 |
require_once (DIR_FS_INC.'xtc_backup_restore_configuration.php'); |
| 179 |
require_once (DIR_FS_INC.'xtc_hide_session_id.inc.php'); |
| 180 |
require_once (DIR_FS_INC.'xtc_get_manufacturers.inc.php'); |
| 181 |
require_once (DIR_FS_INC.'get_messages.inc.php'); |
| 182 |
require_once (DIR_FS_INC.'xtc_get_products_stock.inc.php'); |
| 183 |
|
| 184 |
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/functions/','php') as $file) require_once ($file); |
| 185 |
|
| 186 |
// make a connection to the database... now
|
| 187 |
xtc_db_connect() or die('Unable to connect to database server!'); |
| 188 |
|
| 189 |
// load configuration
|
| 190 |
$configuration_query = xtc_db_query('SELECT configuration_key, configuration_value FROM '.TABLE_CONFIGURATION); |
| 191 |
while ($configuration = xtc_db_fetch_array($configuration_query)) { |
| 192 |
if (function_exists('extra_configuration')) extra_configuration(); |
| 193 |
defined($configuration['configuration_key']) OR define($configuration['configuration_key'], stripslashes($configuration['configuration_value'])); |
| 194 |
} |
| 195 |
|
| 196 |
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/application_top/application_top_begin/','php') as $file) require ($file); |
| 197 |
|
| 198 |
// Set the length of the redeem code, the longer the more secure
|
| 199 |
// Kommt eigentlich schon aus der Table configuration
|
| 200 |
if(!defined('SECURITY_CODE_LENGTH')) { |
| 201 |
define('SECURITY_CODE_LENGTH', '10'); |
| 202 |
} |
| 203 |
|
| 204 |
function CacheCheck() { |
| 205 |
if (USE_CACHE == 'false' |
| 206 |
|| !isset($_COOKIE['MODsid']) |
| 207 |
|| (isset($GLOBALS['disable_smarty_cache']) |
| 208 |
&& $GLOBALS['disable_smarty_cache'] === true |
| 209 |
) |
| 210 |
) |
| 211 |
{
|
| 212 |
return false; |
| 213 |
} |
| 214 |
return true; |
| 215 |
} |
| 216 |
|
| 217 |
// if gzip_compression is enabled start to buffer the output
|
| 218 |
if (GZIP_COMPRESSION == 'true' && $ext_zlib_loaded = extension_loaded('zlib')) { |
| 219 |
require_once (DIR_FS_INC.'xtc_gzip_output.inc.php'); |
| 220 |
require_once (DIR_FS_INC.'xtc_check_gzip.inc.php'); |
| 221 |
if (($ini_zlib_output_compression = (int) ini_get('zlib.output_compression')) < 1) { |
| 222 |
ob_start('ob_gzhandler');
|
| 223 |
} else {
|
| 224 |
ini_set('zlib.output_compression_level', GZIP_LEVEL); |
| 225 |
} |
| 226 |
} |
| 227 |
|
| 228 |
// set the top level domains
|
| 229 |
$http_domain_arr = xtc_get_top_level_domain(HTTP_SERVER); |
| 230 |
$https_domain_arr = xtc_get_top_level_domain(HTTPS_SERVER); |
| 231 |
$http_domain = $http_domain_arr['domain']; |
| 232 |
$https_domain = $https_domain_arr['domain']; |
| 233 |
$current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain); |
| 234 |
|
| 235 |
// set the top level domains to delete
|
| 236 |
$current_domain_delete = (($request_type == 'NONSSL') ? $http_domain_arr['delete'] : $https_domain_arr['delete']); |
| 237 |
|
| 238 |
// include shopping cart class
|
| 239 |
require_once (DIR_WS_CLASSES.'shopping_cart.php'); |
| 240 |
|
| 241 |
// define how the session functions will be used
|
| 242 |
require_once (DIR_WS_FUNCTIONS.'sessions.php'); |
| 243 |
|
| 244 |
// set the session name and save path
|
| 245 |
// set the session cookie parameters
|
| 246 |
// set the session ID if it exists
|
| 247 |
// start the session
|
| 248 |
// Redirect search engines with session id to the same url without session id to prevent indexing session id urls
|
| 249 |
// check for Cookie usage
|
| 250 |
// check the Agent
|
| 251 |
include_once (DIR_WS_MODULES.'set_session_and_cookie_parameters.php'); |
| 252 |
|
| 253 |
// user tracking
|
| 254 |
include_once (DIR_WS_INCLUDES.'tracking.php'); |
| 255 |
|
| 256 |
// verify the ssl_session_id if the feature is enabled
|
| 257 |
// verify the browser user agent if the feature is enabled
|
| 258 |
// verify the IP address if the feature is enabled
|
| 259 |
include_once (DIR_WS_MODULES.'verify_session.php'); |
| 260 |
|
| 261 |
// set the language
|
| 262 |
include_once (DIR_WS_MODULES.'set_language_sessions.php'); |
| 263 |
|
| 264 |
// language translations
|
| 265 |
require_once (DIR_WS_LANGUAGES.$_SESSION['language'].'/'.$_SESSION['language'].'.php'); |
| 266 |
|
| 267 |
// currency
|
| 268 |
include_once (DIR_WS_MODULES.'set_currency_session.php'); |
| 269 |
|
| 270 |
// write customers status in session
|
| 271 |
require_once (DIR_WS_INCLUDES.'write_customers_status.php'); |
| 272 |
|
| 273 |
// content, product, category - sql group_check/fsk_lock
|
| 274 |
require_once (DIR_WS_INCLUDES.'define_conditions.php'); |
| 275 |
|
| 276 |
// add_select
|
| 277 |
require_once (DIR_WS_INCLUDES.'define_add_select.php'); |
| 278 |
|
| 279 |
// shippingcost shoppingcart
|
| 280 |
if (strpos($PHP_SELF, FILENAME_SHOPPING_CART) === false) { |
| 281 |
unset($_SESSION['country']); |
| 282 |
} |
| 283 |
|
| 284 |
// main class
|
| 285 |
require_once (DIR_WS_CLASSES.'main.php'); |
| 286 |
$main = new main(); |
| 287 |
|
| 288 |
// price class
|
| 289 |
require_once (DIR_WS_CLASSES.'xtcPrice.php'); |
| 290 |
$xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']); |
| 291 |
|
| 292 |
// create the shopping cart & fix the cart if necesary
|
| 293 |
if (!isset($_SESSION['cart']) || !is_object($_SESSION['cart'])) { |
| 294 |
$_SESSION['cart'] = new shoppingCart(); |
| 295 |
} |
| 296 |
|
| 297 |
// create the wishlist
|
| 298 |
if (defined('MODULE_WISHLIST_SYSTEM_STATUS') && MODULE_WISHLIST_SYSTEM_STATUS == 'true') { |
| 299 |
if (!isset($_SESSION['wishlist']) || !is_object($_SESSION['wishlist'])) { |
| 300 |
$_SESSION['wishlist'] = new shoppingCart('wishlist'); |
| 301 |
} |
| 302 |
} |
| 303 |
|
| 304 |
// econda tracking
|
| 305 |
if (TRACKING_ECONDA_ACTIVE == 'true') { |
| 306 |
require(DIR_FS_EXTERNAL . 'econda/class.econda.php'); |
| 307 |
require(DIR_FS_EXTERNAL . 'econda/emos.php'); |
| 308 |
$econda = new econda(); |
| 309 |
} |
| 310 |
|
| 311 |
// initialize the message stack for output messages
|
| 312 |
require_once (DIR_WS_CLASSES.'message_stack.php'); |
| 313 |
$messageStack = new messageStack; |
| 314 |
|
| 315 |
require_once (DIR_WS_INCLUDES.FILENAME_CART_ACTIONS); |
| 316 |
|
| 317 |
// who's online functions
|
| 318 |
xtc_update_whos_online(); |
| 319 |
|
| 320 |
// split-page-results
|
| 321 |
require_once (DIR_WS_CLASSES.'split_page_results.php'); |
| 322 |
|
| 323 |
// auto expire special products
|
| 324 |
xtc_expire_specials(); |
| 325 |
|
| 326 |
// class product
|
| 327 |
require_once (DIR_WS_CLASSES.'product.php'); |
| 328 |
|
| 329 |
// set $actual_products_id, $current_category_id, $cPath, $_GET['manufacturers_id']
|
| 330 |
include_once (DIR_WS_MODULES.'set_ids_by_url_parameters.php'); |
| 331 |
|
| 332 |
// breadcrumb class and start the breadcrumb trail
|
| 333 |
require_once (DIR_WS_CLASSES.'breadcrumb.php'); |
| 334 |
$breadcrumb = new breadcrumb; |
| 335 |
include_once (DIR_WS_MODULES.'create_breadcrumb.php'); |
| 336 |
|
| 337 |
// set which precautions should be checked
|
| 338 |
defined('WARN_INSTALL_EXISTENCE') OR define('WARN_INSTALL_EXISTENCE', 'true'); |
| 339 |
defined('WARN_CONFIG_WRITEABLE') OR define('WARN_CONFIG_WRITEABLE', 'true'); |
| 340 |
defined('WARN_FILES_WRITEABLE') OR define('WARN_FILES_WRITEABLE', 'true'); |
| 341 |
defined('WARN_DIRS_WRITEABLE') OR define('WARN_DIRS_WRITEABLE', 'true'); |
| 342 |
defined('WARN_SESSION_DIRECTORY_NOT_WRITEABLE') OR define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true'); |
| 343 |
defined('WARN_SESSION_AUTO_START') OR define('WARN_SESSION_AUTO_START', 'true'); |
| 344 |
defined('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE') OR define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'); |
| 345 |
|
| 346 |
// modification for nre graduated system
|
| 347 |
unset ($_SESSION['actual_content']); |
| 348 |
xtc_count_cart(); |
| 349 |
|
| 350 |
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/application_top/application_top_end/','php') as $file) require_once ($file); |
| 351 |
|
| 352 |
//compatibility for modified eCommerce Shopsoftware 1.06 files
|
| 353 |
defined('DIR_WS_BASE') OR define('DIR_WS_BASE', ''); |
| 354 |
?>
|