Projekt

Allgemein

Profil

Statistiken
| Revision:

testmodus / includes / application_top.php @ 1

Historie | Anzeigen | Annotieren | Download (12,9 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
// start the timer for the page parse time log
37
define('PAGE_PARSE_START_TIME', microtime(true));
38

    
39
// set the level of error reporting
40
@ini_set('display_errors', false);
41
error_reporting(0);
42

    
43
// configuration parameters
44
if (file_exists('includes/local/configure.php')) {
45
  include_once ('includes/local/configure.php');
46
} else {
47
  include_once ('includes/configure.php');
48
}
49

    
50
// call Installer
51
if ((DB_DATABASE == '' || !defined('DB_MYSQL_TYPE')) && is_dir('./_installer')) {
52
  header("Location: ./_installer");
53
  exit();
54
}
55

    
56
// minimum requirement
57
if (version_compare(PHP_VERSION, '5.6', '<')) {
58
  die('<h1>Minimum requirement PHP Version 5.6</h1>');
59
}
60

    
61
// default time zone
62
date_default_timezone_set('Europe/Berlin');
63

    
64
// new error handling
65
if (is_file(DIR_WS_INCLUDES.'error_reporting.php')) {
66
  require_once (DIR_WS_INCLUDES.'error_reporting.php');
67
}
68

    
69
// security inputfilter for GET/POST/COOKIE
70
require_once (DIR_FS_INC.'html_encoding.php');
71
require_once (DIR_WS_CLASSES.'class.inputfilter.php');
72
$InputFilter = new InputFilter();
73

    
74
$_GET = $InputFilter->process($_GET);
75
$_POST = $InputFilter->process($_POST);
76
$_REQUEST = $InputFilter->process($_REQUEST);
77
$_GET = $InputFilter->safeSQL($_GET);
78
$_POST = $InputFilter->safeSQL($_POST);
79
$_REQUEST = $InputFilter->safeSQL($_REQUEST);
80

    
81
// auto include
82
require_once (DIR_FS_INC . 'auto_include.inc.php');
83

    
84
// include the list of project filenames
85
require_once (DIR_WS_INCLUDES.'filenames.php');
86

    
87
// Debug-Log-Class - thx to franky
88
include_once (DIR_WS_CLASSES.'class.debug.php');
89
$log = new debug;
90

    
91
// project version
92
define('PROJECT_VERSION', 'modified eCommerce Shopsoftware');
93

    
94
define('TAX_DECIMAL_PLACES', 0);
95

    
96
// set the type of request (secure or not)
97
if (file_exists(DIR_WS_INCLUDES.'request_type.php')) {
98
  include_once (DIR_WS_INCLUDES.'request_type.php');
99
} else {
100
  $request_type = 'NONSSL';
101
}
102

    
103
// Base/PHP_SELF/SSL-PROXY
104
require_once (DIR_FS_INC . 'set_php_self.inc.php');
105
$PHP_SELF = set_php_self();
106

    
107
// list of project database tables
108
require_once (DIR_WS_INCLUDES.'database_tables.php');
109

    
110
// graduated prices model or products assigned ?
111
define('GRADUATED_ASSIGN', 'true');
112

    
113
// Database
114
require_once (DIR_FS_INC.'db_functions_'.DB_MYSQL_TYPE.'.inc.php');
115
require_once (DIR_FS_INC.'db_functions.inc.php');
116

    
117
// html basics
118
require_once (DIR_FS_INC.'xtc_href_link.inc.php');
119
require_once (DIR_FS_INC.'xtc_php_mail.inc.php');
120

    
121
require_once (DIR_FS_INC.'xtc_product_link.inc.php');
122
require_once (DIR_FS_INC.'xtc_category_link.inc.php');
123
require_once (DIR_FS_INC.'xtc_manufacturer_link.inc.php');
124

    
125
// html functions
126
require_once (DIR_FS_INC.'xtc_draw_checkbox_field.inc.php');
127
require_once (DIR_FS_INC.'xtc_draw_form.inc.php');
128
require_once (DIR_FS_INC.'xtc_draw_hidden_field.inc.php');
129
require_once (DIR_FS_INC.'xtc_draw_input_field.inc.php');
130
require_once (DIR_FS_INC.'xtc_draw_password_field.inc.php');
131
require_once (DIR_FS_INC.'xtc_draw_pull_down_menu.inc.php');
132
require_once (DIR_FS_INC.'xtc_draw_radio_field.inc.php');
133
require_once (DIR_FS_INC.'xtc_draw_selection_field.inc.php');
134
require_once (DIR_FS_INC.'xtc_draw_separator.inc.php');
135
require_once (DIR_FS_INC.'xtc_draw_textarea_field.inc.php');
136
require_once (DIR_FS_INC.'xtc_image_button.inc.php');
137
require_once (DIR_FS_INC.'xtc_image_submit.inc.php');
138

    
139
require_once (DIR_FS_INC.'xtc_not_null.inc.php');
140
require_once (DIR_FS_INC.'xtc_update_whos_online.inc.php');
141
require_once (DIR_FS_INC.'xtc_activate_banners.inc.php');
142
require_once (DIR_FS_INC.'xtc_expire_banners.inc.php');
143
require_once (DIR_FS_INC.'xtc_expire_specials.inc.php');
144
require_once (DIR_FS_INC.'xtc_parse_category_path.inc.php');
145
require_once (DIR_FS_INC.'xtc_get_product_path.inc.php');
146
require_once (DIR_FS_INC.'xtc_get_top_level_domain.inc.php');
147
require_once (DIR_FS_INC.'xtc_get_category_path.inc.php');
148
require_once (DIR_FS_INC.'xtc_get_content_path.inc.php');
149

    
150
require_once (DIR_FS_INC.'xtc_get_parent_categories.inc.php');
151
require_once (DIR_FS_INC.'xtc_redirect.inc.php');
152
require_once (DIR_FS_INC.'xtc_get_uprid.inc.php');
153
require_once (DIR_FS_INC.'xtc_get_all_get_params.inc.php');
154
require_once (DIR_FS_INC.'xtc_has_product_attributes.inc.php');
155
require_once (DIR_FS_INC.'xtc_image.inc.php');
156
require_once (DIR_FS_INC.'xtc_check_stock.inc.php');
157
require_once (DIR_FS_INC.'xtc_check_stock_attributes.inc.php');
158
require_once (DIR_FS_INC.'xtc_currency_exists.inc.php');
159
require_once (DIR_FS_INC.'xtc_remove_non_numeric.inc.php');
160
require_once (DIR_FS_INC.'xtc_get_ip_address.inc.php');
161
require_once (DIR_FS_INC.'xtc_setcookie.inc.php');
162
require_once (DIR_FS_INC.'xtc_check_agent.inc.php');
163
require_once (DIR_FS_INC.'xtc_count_cart.inc.php');
164
require_once (DIR_FS_INC.'xtc_get_qty.inc.php');
165
require_once (DIR_FS_INC.'create_coupon_code.inc.php');
166
require_once (DIR_FS_INC.'xtc_gv_account_update.inc.php');
167
require_once (DIR_FS_INC.'xtc_get_tax_rate_from_desc.inc.php');
168
require_once (DIR_FS_INC.'xtc_get_tax_rate.inc.php');
169
require_once (DIR_FS_INC.'xtc_add_tax.inc.php');
170
require_once (DIR_FS_INC.'xtc_cleanName.inc.php');
171
require_once (DIR_FS_INC.'xtc_calculate_tax.inc.php');
172
require_once (DIR_FS_INC.'xtc_input_validation.inc.php');
173
require_once (DIR_FS_INC.'xtc_js_lang.php');
174
require_once (DIR_FS_INC.'xtc_backup_restore_configuration.php');
175
require_once (DIR_FS_INC.'xtc_hide_session_id.inc.php');
176
require_once (DIR_FS_INC.'xtc_get_manufacturers.inc.php');
177
require_once (DIR_FS_INC.'get_messages.inc.php');
178
require_once (DIR_FS_INC.'xtc_get_products_stock.inc.php');
179

    
180
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/functions/','php') as $file) require_once ($file);
181

    
182
// make a connection to the database... now
183
xtc_db_connect() or die('Unable to connect to database server!');
184

    
185
// load configuration
186
$configuration_query = xtc_db_query('SELECT configuration_key, configuration_value FROM '.TABLE_CONFIGURATION);
187
while ($configuration = xtc_db_fetch_array($configuration_query)) {
188
  if (function_exists('extra_configuration')) extra_configuration();
189
  defined($configuration['configuration_key']) OR define($configuration['configuration_key'], stripslashes($configuration['configuration_value']));
190
}
191

    
192
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/application_top/application_top_begin/','php') as $file) require ($file);
193

    
194
// Set the length of the redeem code, the longer the more secure
195
// Kommt eigentlich schon aus der Table configuration
196
if(!defined('SECURITY_CODE_LENGTH')) {
197
  define('SECURITY_CODE_LENGTH', '10');
198
}
199

    
200
function CacheCheck() {
201
  if (USE_CACHE == 'false'
202
      || !isset($_COOKIE['MODsid'])
203
      || (isset($GLOBALS['disable_smarty_cache']) 
204
          && $GLOBALS['disable_smarty_cache'] === true
205
          )
206
      )
207
  {
208
    return false;
209
  }
210
  return true;
211
}
212

    
213
// if gzip_compression is enabled start to buffer the output
214
if (GZIP_COMPRESSION == 'true' && $ext_zlib_loaded = extension_loaded('zlib')) {
215
  require_once (DIR_FS_INC.'xtc_gzip_output.inc.php');
216
  require_once (DIR_FS_INC.'xtc_check_gzip.inc.php');
217
  if (($ini_zlib_output_compression = (int) ini_get('zlib.output_compression')) < 1) {
218
    ob_start('ob_gzhandler');
219
  } else {
220
    ini_set('zlib.output_compression_level', GZIP_LEVEL);
221
  }
222
}
223

    
224
// set the top level domains
225
$http_domain_arr = xtc_get_top_level_domain(HTTP_SERVER);
226
$https_domain_arr = xtc_get_top_level_domain(HTTPS_SERVER);
227
$http_domain = $http_domain_arr['domain'];
228
$https_domain = $https_domain_arr['domain'];
229
$current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain);
230

    
231
// set the top level domains to delete
232
$current_domain_delete = (($request_type == 'NONSSL') ? $http_domain_arr['delete'] : $https_domain_arr['delete']);
233

    
234
// include shopping cart class
235
require_once (DIR_WS_CLASSES.'shopping_cart.php');
236

    
237
// define how the session functions will be used
238
require_once (DIR_WS_FUNCTIONS.'sessions.php');
239

    
240
// set the session name and save path
241
// set the session cookie parameters
242
// set the session ID if it exists
243
// start the session
244
// Redirect search engines with session id to the same url without session id to prevent indexing session id urls
245
// check for Cookie usage
246
// check the Agent
247
include_once (DIR_WS_MODULES.'set_session_and_cookie_parameters.php');
248

    
249
// user tracking
250
include_once (DIR_WS_INCLUDES.'tracking.php');
251

    
252
// verify the ssl_session_id if the feature is enabled
253
// verify the browser user agent if the feature is enabled
254
// verify the IP address if the feature is enabled
255
include_once (DIR_WS_MODULES.'verify_session.php');
256

    
257
// set the language
258
include_once (DIR_WS_MODULES.'set_language_sessions.php');
259

    
260
// language translations
261
require_once (DIR_WS_LANGUAGES.$_SESSION['language'].'/'.$_SESSION['language'].'.php');
262

    
263
// currency
264
include_once (DIR_WS_MODULES.'set_currency_session.php');
265

    
266
// write customers status in session
267
require_once (DIR_WS_INCLUDES.'write_customers_status.php');
268

    
269
// content, product, category - sql group_check/fsk_lock
270
require_once (DIR_WS_INCLUDES.'define_conditions.php');
271

    
272
// add_select
273
require_once (DIR_WS_INCLUDES.'define_add_select.php');
274

    
275
// shippingcost shoppingcart
276
if (strpos($PHP_SELF, FILENAME_SHOPPING_CART) === false) {
277
  unset($_SESSION['country']);
278
}
279

    
280
// main class
281
require_once (DIR_WS_CLASSES.'main.php');
282
$main = new main();
283

    
284
// price class
285
require_once (DIR_WS_CLASSES.'xtcPrice.php');
286
$xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
287

    
288
// create the shopping cart & fix the cart if necesary
289
if (!isset($_SESSION['cart']) || !is_object($_SESSION['cart'])) {
290
  $_SESSION['cart'] = new shoppingCart();
291
}
292

    
293
// create the wishlist
294
if (defined('MODULE_WISHLIST_SYSTEM_STATUS') && MODULE_WISHLIST_SYSTEM_STATUS == 'true') {
295
  if (!isset($_SESSION['wishlist']) || !is_object($_SESSION['wishlist'])) {
296
    $_SESSION['wishlist'] = new shoppingCart('wishlist');
297
  }
298
}
299

    
300
// econda tracking
301
if (TRACKING_ECONDA_ACTIVE == 'true') {
302
  require(DIR_FS_EXTERNAL . 'econda/class.econda.php');
303
  require(DIR_FS_EXTERNAL . 'econda/emos.php');
304
  $econda = new econda();
305
}
306

    
307
// initialize the message stack for output messages
308
require_once (DIR_WS_CLASSES.'message_stack.php');
309
$messageStack = new messageStack;
310

    
311
require_once (DIR_WS_INCLUDES.FILENAME_CART_ACTIONS);
312

    
313
// who's online functions
314
xtc_update_whos_online();
315

    
316
// split-page-results
317
require_once (DIR_WS_CLASSES.'split_page_results.php');
318

    
319
// auto expire special products
320
xtc_expire_specials();
321

    
322
// class product
323
require_once (DIR_WS_CLASSES.'product.php');
324

    
325
// set $actual_products_id,  $current_category_id, $cPath, $_GET['manufacturers_id']
326
include_once (DIR_WS_MODULES.'set_ids_by_url_parameters.php');
327

    
328
// breadcrumb class and start the breadcrumb trail
329
require_once (DIR_WS_CLASSES.'breadcrumb.php');
330
$breadcrumb = new breadcrumb;
331
include_once (DIR_WS_MODULES.'create_breadcrumb.php');
332

    
333
// set which precautions should be checked
334
defined('WARN_INSTALL_EXISTENCE') OR define('WARN_INSTALL_EXISTENCE', 'true');
335
defined('WARN_CONFIG_WRITEABLE') OR define('WARN_CONFIG_WRITEABLE', 'true');
336
defined('WARN_FILES_WRITEABLE') OR define('WARN_FILES_WRITEABLE', 'true');
337
defined('WARN_DIRS_WRITEABLE') OR define('WARN_DIRS_WRITEABLE', 'true');
338
defined('WARN_SESSION_DIRECTORY_NOT_WRITEABLE') OR define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
339
defined('WARN_SESSION_AUTO_START') OR define('WARN_SESSION_AUTO_START', 'true');
340
defined('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE') OR define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
341

    
342
// modification for nre graduated system
343
unset ($_SESSION['actual_content']);
344
xtc_count_cart();
345

    
346
foreach(auto_include(DIR_FS_CATALOG.'includes/extra/application_top/application_top_end/','php') as $file) require_once ($file);
347

    
348
//compatibility for modified eCommerce Shopsoftware 1.06 files
349
defined('DIR_WS_BASE') OR define('DIR_WS_BASE', '');
350
?>