PageRenderTime 117ms CodeModel.GetById 60ms app.highlight 29ms RepoModel.GetById 21ms app.codeStats 1ms

/includes/application_top.php

https://bitbucket.org/gakos/khomecommerce
PHP | 521 lines | 379 code | 73 blank | 69 comment | 151 complexity | be981d3f8284c2160e3d62677e24b987 MD5 | raw file
  1<?php
  2/*
  3  $Id: application_top.php 1833 2008-01-30 22:03:30Z hpdl $
  4
  5  osCommerce, Open Source E-Commerce Solutions
  6  http://www.oscommerce.com
  7
  8  Copyright (c) 2008 osCommerce
  9
 10  Released under the GNU General Public License
 11*/
 12
 13// start the timer for the page parse time log
 14  define('PAGE_PARSE_START_TIME', microtime());
 15
 16// set the level of error reporting
 17  error_reporting(E_ALL & ~E_NOTICE);
 18
 19// check support for register_globals
 20  if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {
 21    exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');
 22  }
 23
 24// Set the local configuration parameters - mainly for developers
 25  if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
 26
 27// include server parameters
 28	require('includes/configure.php');
 29	require('includes/custom_urls.php');
 30	require('includes/sizes.php');
 31
 32  if (strlen(DB_SERVER) < 1) {
 33    if (is_dir('install')) {
 34      header('Location: install/index.php');
 35    }
 36  }
 37
 38// define the project version
 39  define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');
 40
 41// some code to solve compatibility issues
 42  require(DIR_WS_FUNCTIONS . 'compatibility.php');
 43
 44// set the type of request (secure or not)
 45  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
 46
 47// set php_self in the local scope
 48  if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
 49
 50  if ($request_type == 'NONSSL') {
 51    define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
 52  } else {
 53    define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
 54  }
 55
 56// include the list of project filenames
 57  require(DIR_WS_INCLUDES . 'filenames.php');
 58
 59// include the list of project database tables
 60  require(DIR_WS_INCLUDES . 'database_tables.php');
 61
 62// customization for the design layout
 63  define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)
 64
 65// include the database functions
 66  require(DIR_WS_FUNCTIONS . 'database.php');
 67
 68// make a connection to the database... now
 69  tep_db_connect() or die('Unable to connect to database server!');
 70
 71// set the application parameters
 72  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 73  while ($configuration = tep_db_fetch_array($configuration_query)) {
 74    define($configuration['cfgKey'], $configuration['cfgValue']);
 75  }
 76
 77// if gzip_compression is enabled, start to buffer the output
 78  if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
 79    if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
 80      if (PHP_VERSION >= '4.0.4') {
 81        ob_start('ob_gzhandler');
 82      } else {
 83        include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
 84        ob_start();
 85        ob_implicit_flush();
 86      }
 87    } else {
 88      ini_set('zlib.output_compression_level', GZIP_LEVEL);
 89    }
 90  }
 91
 92// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
 93  if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
 94    if (strlen(getenv('PATH_INFO')) > 1) {
 95      $GET_array = array();
 96      $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
 97      $vars = explode('/', substr(getenv('PATH_INFO'), 1));
 98      for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
 99        if (strpos($vars[$i], '[]')) {
100          $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
101        } else {
102          $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
103        }
104        $i++;
105      }
106
107      if (sizeof($GET_array) > 0) {
108        while (list($key, $value) = each($GET_array)) {
109          $HTTP_GET_VARS[$key] = $value;
110        }
111      }
112    }
113  }
114
115// define general functions used application-wide
116  require(DIR_WS_FUNCTIONS . 'general.php');
117  require(DIR_WS_FUNCTIONS . 'html_output.php');
118
119// set the cookie domain
120  $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
121  $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);
122
123// include cache functions if enabled
124  if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');
125
126// include shopping cart class
127  require(DIR_WS_CLASSES . 'shopping_cart.php');
128
129// include navigation history class
130  require(DIR_WS_CLASSES . 'navigation_history.php');
131
132// check if sessions are supported, otherwise use the php3 compatible session class
133  if (!function_exists('session_start')) {
134    define('PHP_SESSION_NAME', 'osCsid');
135    define('PHP_SESSION_PATH', $cookie_path);
136    define('PHP_SESSION_DOMAIN', $cookie_domain);
137    define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
138
139    include(DIR_WS_CLASSES . 'sessions.php');
140  }
141
142// define how the session functions will be used
143  require(DIR_WS_FUNCTIONS . 'sessions.php');
144
145// set the session name and save path
146  tep_session_name('osCsid');
147  tep_session_save_path(SESSION_WRITE_DIRECTORY);
148
149// set the session cookie parameters
150   if (function_exists('session_set_cookie_params')) {
151    session_set_cookie_params(0, $cookie_path, $cookie_domain);
152  } elseif (function_exists('ini_set')) {
153    ini_set('session.cookie_lifetime', '0');
154    ini_set('session.cookie_path', $cookie_path);
155    ini_set('session.cookie_domain', $cookie_domain);
156  }
157
158// set the session ID if it exists
159   if (isset($HTTP_POST_VARS[tep_session_name()])) {
160     tep_session_id($HTTP_POST_VARS[tep_session_name()]);
161   } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {
162     tep_session_id($HTTP_GET_VARS[tep_session_name()]);
163   }
164
165// start the session
166  $session_started = false;
167  if (SESSION_FORCE_COOKIE_USE == 'True') {
168    tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);
169
170    if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
171      tep_session_start();
172      $session_started = true;
173    }
174  } elseif (SESSION_BLOCK_SPIDERS == 'True') {
175    $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
176    $spider_flag = false;
177
178    if (tep_not_null($user_agent)) {
179      $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
180
181      for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
182        if (tep_not_null($spiders[$i])) {
183          if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
184            $spider_flag = true;
185            break;
186          }
187        }
188      }
189    }
190
191    if ($spider_flag == false) {
192      tep_session_start();
193      $session_started = true;
194    }
195  } else {
196    tep_session_start();
197    $session_started = true;
198  }
199
200  if ( ($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
201    extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
202  }
203
204// set SID once, even if empty
205  $SID = (defined('SID') ? SID : '');
206
207// verify the ssl_session_id if the feature is enabled
208  if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
209    $ssl_session_id = getenv('SSL_SESSION_ID');
210    if (!tep_session_is_registered('SSL_SESSION_ID')) {
211      $SESSION_SSL_ID = $ssl_session_id;
212      tep_session_register('SESSION_SSL_ID');
213    }
214
215    if ($SESSION_SSL_ID != $ssl_session_id) {
216      tep_session_destroy();
217      tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
218    }
219  }
220
221// verify the browser user agent if the feature is enabled
222  if (SESSION_CHECK_USER_AGENT == 'True') {
223    $http_user_agent = getenv('HTTP_USER_AGENT');
224    if (!tep_session_is_registered('SESSION_USER_AGENT')) {
225      $SESSION_USER_AGENT = $http_user_agent;
226      tep_session_register('SESSION_USER_AGENT');
227    }
228
229    if ($SESSION_USER_AGENT != $http_user_agent) {
230      tep_session_destroy();
231      tep_redirect(tep_href_link(FILENAME_LOGIN));
232    }
233  }
234
235// verify the IP address if the feature is enabled
236  if (SESSION_CHECK_IP_ADDRESS == 'True') {
237    $ip_address = tep_get_ip_address();
238    if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
239      $SESSION_IP_ADDRESS = $ip_address;
240      tep_session_register('SESSION_IP_ADDRESS');
241    }
242
243    if ($SESSION_IP_ADDRESS != $ip_address) {
244      tep_session_destroy();
245      tep_redirect(tep_href_link(FILENAME_LOGIN));
246    }
247  }
248
249// create the shopping cart & fix the cart if necesary
250  if (tep_session_is_registered('cart') && is_object($cart)) {
251    if (PHP_VERSION < 4) {
252      $broken_cart = $cart;
253      $cart = new shoppingCart;
254      $cart->unserialize($broken_cart);
255    }
256  } else {
257    tep_session_register('cart');
258    $cart = new shoppingCart;
259  }
260
261// include currencies class and create an instance
262  require(DIR_WS_CLASSES . 'currencies.php');
263  $currencies = new currencies();
264
265// include the mail classes
266  require(DIR_WS_CLASSES . 'mime.php');
267  require(DIR_WS_CLASSES . 'email.php');
268
269// set the language
270  if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
271    if (!tep_session_is_registered('language')) {
272      tep_session_register('language');
273      tep_session_register('languages_id');
274    }
275
276    include(DIR_WS_CLASSES . 'language.php');
277    $lng = new language();
278
279    if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
280      $lng->set_language($HTTP_GET_VARS['language']);
281    } else {
282      //$lng->get_browser_language();
283    }
284
285    $language = $lng->language['directory'];
286    $languages_id = $lng->language['id'];
287  }
288
289// include the language translations
290  require(DIR_WS_LANGUAGES . $language . '.php');
291
292// currency
293  if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
294    if (!tep_session_is_registered('currency')) tep_session_register('currency');
295
296    if (isset($HTTP_GET_VARS['currency']) && $currencies->is_set($HTTP_GET_VARS['currency'])) {
297      $currency = $HTTP_GET_VARS['currency'];
298    } else {
299      $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
300    }
301  }
302
303// navigation history
304  if (tep_session_is_registered('navigation')) {
305    if (PHP_VERSION < 4) {
306      $broken_navigation = $navigation;
307      $navigation = new navigationHistory;
308      $navigation->unserialize($broken_navigation);
309    }
310  } else {
311    tep_session_register('navigation');
312    $navigation = new navigationHistory;
313  }
314  $navigation->add_current_page();
315
316// Shopping cart actions
317  if (isset($HTTP_GET_VARS['action'])) {
318// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
319    if ($session_started == false) {
320      tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
321    }
322
323    if (DISPLAY_CART == 'true') {
324      $goto =  FILENAME_SHOPPING_CART;
325      $parameters = array('action', 'cPath', 'products_id', 'pid');
326    } else {
327      $goto = basename($PHP_SELF);
328      if ($HTTP_GET_VARS['action'] == 'buy_now') {
329        $parameters = array('action', 'pid', 'products_id');
330      } else {
331        $parameters = array('action', 'pid');
332      }
333    }
334    switch ($HTTP_GET_VARS['action']) {
335      // customer wants to update the product quantity in their shopping cart
336      case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
337                                if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
338                                  $cart->remove($HTTP_POST_VARS['products_id'][$i]);
339                                } else {
340                                  if (PHP_VERSION < 4) {
341                                    // if PHP3, make correction for lack of multidimensional array.
342                                    reset($HTTP_POST_VARS);
343                                    while (list($key, $value) = each($HTTP_POST_VARS)) {
344                                      if (is_array($value)) {
345                                        while (list($key2, $value2) = each($value)) {
346                                          if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
347                                            $id2[$var[1]][$var[2]] = $value2;
348                                          }
349                                        }
350                                      }
351                                    }
352                                    $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';
353                                  } else {
354                                    $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
355                                  }
356                                  $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
357                                }
358                              }
359                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
360                              break;
361      // customer adds a product from the products page
362		case 'select_size': ;
363      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
364                                $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
365                              }
366                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
367                              break;
368      // performed by the 'buy now' button in product listings and review page
369      case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
370                                if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
371                                  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
372                                } else {
373                                  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
374                                }
375                              }
376                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
377                              break;
378      case 'notify' :         if (tep_session_is_registered('customer_id')) {
379                                if (isset($HTTP_GET_VARS['products_id'])) {
380                                  $notify = $HTTP_GET_VARS['products_id'];
381                                } elseif (isset($HTTP_GET_VARS['notify'])) {
382                                  $notify = $HTTP_GET_VARS['notify'];
383                                } elseif (isset($HTTP_POST_VARS['notify'])) {
384                                  $notify = $HTTP_POST_VARS['notify'];
385                                } else {
386                                  tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
387                                }
388                                if (!is_array($notify)) $notify = array($notify);
389                                for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
390                                  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
391                                  $check = tep_db_fetch_array($check_query);
392                                  if ($check['count'] < 1) {
393                                    tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
394                                  }
395                                }
396                                tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
397                              } else {
398                                $navigation->set_snapshot();
399                                tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
400                              }
401                              break;
402      case 'notify_remove' :  if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
403                                $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
404                                $check = tep_db_fetch_array($check_query);
405                                if ($check['count'] > 0) {
406                                  tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
407                                }
408                                tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
409                              } else {
410                                $navigation->set_snapshot();
411                                tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
412                              }
413                              break;
414      case 'cust_order' :     if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
415                                if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
416                                  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
417                                } else {
418                                  $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
419                                }
420                              }
421                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
422                              break;
423    }
424  }
425
426// include the who's online functions
427  require(DIR_WS_FUNCTIONS . 'whos_online.php');
428  tep_update_whos_online();
429
430// include the password crypto functions
431  require(DIR_WS_FUNCTIONS . 'password_funcs.php');
432
433// include validation functions (right now only email address)
434  require(DIR_WS_FUNCTIONS . 'validations.php');
435
436// split-page-results
437  require(DIR_WS_CLASSES . 'split_page_results.php');
438
439// infobox
440  require(DIR_WS_CLASSES . 'boxes.php');
441
442// auto activate and expire banners
443  require(DIR_WS_FUNCTIONS . 'banner.php');
444  tep_activate_banners();
445  tep_expire_banners();
446
447// auto expire special products
448  require(DIR_WS_FUNCTIONS . 'specials.php');
449  tep_expire_specials();
450
451// calculate category path
452  if (isset($HTTP_GET_VARS['cPath'])) {
453    $cPath = $HTTP_GET_VARS['cPath'];
454  } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
455    $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
456  } else {
457    $cPath = '';
458  }
459
460  if (tep_not_null($cPath)) {
461    $cPath_array = tep_parse_category_path($cPath);
462    $cPath = implode('_', $cPath_array);
463    $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
464  } else {
465    $current_category_id = 0;
466  }
467
468// include the breadcrumb class and start the breadcrumb trail
469  require(DIR_WS_CLASSES . 'breadcrumb.php');
470  $breadcrumb = new breadcrumb;
471
472  $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
473  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));
474
475// add category names or the manufacturer name to the breadcrumb trail
476  if (isset($cPath_array)) {
477    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
478      $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
479      if (tep_db_num_rows($categories_query) > 0) {
480        $categories = tep_db_fetch_array($categories_query);
481        $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
482      } else {
483        break;
484      }
485    }
486  } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
487    $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
488    if (tep_db_num_rows($manufacturers_query)) {
489      $manufacturers = tep_db_fetch_array($manufacturers_query);
490      $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
491    }
492  }
493
494// add the products model to the breadcrumb trail
495  if (isset($HTTP_GET_VARS['products_id'])) {
496    $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
497    if (tep_db_num_rows($model_query)) {
498      $model = tep_db_fetch_array($model_query);
499      $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
500    }
501  }
502
503$doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
504   "http://www.w3.org/TR/html4/loose.dtd">';
505$stylesheet='<link rel="stylesheet" href="css/stylesheet.css" type="text/css"> 
506	<link rel="stylesheet" href="css/main.css" type="text/css">';
507$scriptsheet = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
508<script type="text/javascript" src="scripts/jquery.vertical.gallery.js"></script>
509<script type="text/javascript" src="scripts/functions.js"></script>';
510
511// initialize the message stack for output messages
512  require(DIR_WS_CLASSES . 'message_stack.php');
513  $messageStack = new messageStack;
514
515// set which precautions should be checked
516  define('WARN_INSTALL_EXISTENCE', 'true');
517  define('WARN_CONFIG_WRITEABLE', 'true');
518  define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
519  define('WARN_SESSION_AUTO_START', 'true');
520  define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
521?>