[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/includes/ -> application_top.php (source)

   1  <?php
   2  /*

   3  $Id: application_top.php 18 2006-08-04 19:02:36Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13  // Start the clock 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 application configuration parameters

  28    require ('includes/configure.php');
  29  
  30  // Define the project version

  31    define('PROJECT_VERSION', 'osCMax v2.0.4');
  32  
  33  // some code to solve compatibility issues

  34    require (DIR_WS_FUNCTIONS . 'compatibility.php');
  35  
  36  // set php_self in the local scope

  37    $PHP_SELF = $_SERVER['PHP_SELF'];
  38    
  39  // Used in the "Backup Manager" to compress backups

  40    define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
  41    define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
  42    define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
  43    define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');
  44  
  45  // include the list of project filenames

  46    require (DIR_WS_INCLUDES . 'filenames.php');
  47  
  48  // include the list of project database tables

  49    require (DIR_WS_INCLUDES . 'database_tables.php');
  50  
  51  // customization for the design layout

  52    define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

  53  
  54  // Define how do we update currency exchange rates

  55  // Possible values are 'oanda' 'xe' or ''

  56    define('CURRENCY_SERVER_PRIMARY', 'oanda');
  57    define('CURRENCY_SERVER_BACKUP', 'xe');
  58  
  59  // include the database functions

  60    require (DIR_WS_FUNCTIONS . 'database.php');
  61  
  62  // make a connection to the database... now

  63    tep_db_connect() or die('Unable to connect to database server!');
  64  
  65  // set application wide parameters

  66    $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
  67    while ($configuration = tep_db_fetch_array($configuration_query)) {
  68      define($configuration['cfgKey'], $configuration['cfgValue']);
  69    }
  70  
  71  // define our general functions used application-wide

  72    require (DIR_WS_FUNCTIONS . 'general.php');
  73    require (DIR_WS_FUNCTIONS . 'html_output.php');
  74  
  75  // LINE ADDED: MOD - Admin w/access levels

  76    require (DIR_WS_FUNCTIONS . 'password_funcs.php');
  77  
  78  // initialize the logger class

  79    require(DIR_WS_CLASSES . 'logger.php');
  80  
  81  // include shopping cart class

  82    require (DIR_WS_CLASSES . 'shopping_cart.php');
  83  
  84  // check to see if php implemented session management functions - if not, include php3/php4 compatible session class

  85    if (!function_exists('session_start')) {
  86      define('PHP_SESSION_NAME', 'osCAdminID');
  87      define('PHP_SESSION_PATH', '/');
  88      define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
  89  
  90      include (DIR_WS_CLASSES . 'sessions.php');
  91    }
  92  
  93  // define how the session functions will be used

  94    require (DIR_WS_FUNCTIONS . 'sessions.php');
  95  
  96  // set the session name and save path

  97    tep_session_name('osCAdminID');
  98    tep_session_save_path(SESSION_WRITE_DIRECTORY);
  99  
 100  // set the session cookie parameters

 101     if (function_exists('session_set_cookie_params')) {
 102      session_set_cookie_params(0, DIR_WS_ADMIN);
 103    } elseif (function_exists('ini_set')) {
 104      ini_set('session.cookie_lifetime', '0');
 105      ini_set('session.cookie_path', DIR_WS_ADMIN);
 106    }
 107  
 108  // lets start our session

 109    tep_session_start();
 110  
 111    if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
 112      extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
 113    }
 114  
 115  // set the language

 116    if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
 117      if (!tep_session_is_registered('language')) {
 118        tep_session_register('language');
 119        tep_session_register('languages_id');
 120      }
 121  
 122      include (DIR_WS_CLASSES . 'language.php');
 123      $lng = new language();
 124  
 125      if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
 126        $lng->set_language($HTTP_GET_VARS['language']);
 127      } else {
 128        $lng->get_browser_language();
 129      }
 130  
 131      $language = $lng->language['directory'];
 132      $languages_id = $lng->language['id'];
 133    }
 134  
 135  // include the language translations

 136    require(DIR_WS_LANGUAGES . $language . '.php');
 137    $current_page = basename($_SERVER['SCRIPT_FILENAME']);
 138    if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
 139      include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
 140    }
 141  
 142  // define our localization functions

 143    require(DIR_WS_FUNCTIONS . 'localization.php');
 144  
 145  // Include validation functions (right now only email address)

 146    require (DIR_WS_FUNCTIONS . 'validations.php');
 147  
 148  // setup our boxes

 149    require(DIR_WS_CLASSES . 'table_block.php');
 150    require(DIR_WS_CLASSES . 'box.php');
 151  
 152  // initialize the message stack for output messages

 153    require (DIR_WS_CLASSES . 'message_stack.php');
 154    $messageStack = new messageStack;
 155  
 156  // split-page-results

 157    require (DIR_WS_CLASSES . 'split_page_results.php');
 158  
 159  // entry/item info classes

 160    require(DIR_WS_CLASSES . 'object_info.php');
 161  
 162  // email classes

 163    require (DIR_WS_CLASSES . 'mime.php');
 164    require (DIR_WS_CLASSES . 'email.php');
 165  
 166  // file uploading class

 167    require(DIR_WS_CLASSES . 'upload.php');
 168  
 169  // calculate category path

 170    if (isset($HTTP_GET_VARS['cPath'])) {
 171      $cPath = $HTTP_GET_VARS['cPath'];
 172    } else {
 173      $cPath = '';
 174    }
 175  
 176    if (tep_not_null($cPath)) {
 177      $cPath_array = tep_parse_category_path($cPath);
 178      $cPath = implode('_', $cPath_array);
 179      $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 180    } else {
 181      $current_category_id = 0;
 182    }
 183  
 184  // default open navigation box

 185    if (!tep_session_is_registered('selected_box')) {
 186      tep_session_register('selected_box');
 187      $selected_box = 'configuration';
 188    }
 189  
 190    if (isset($HTTP_GET_VARS['selected_box'])) {
 191      $selected_box = $HTTP_GET_VARS['selected_box'];
 192    }
 193  
 194  // the following cache blocks are used in the Tools->Cache section

 195  // ('language' in the filename is automatically replaced by available languages)

 196    $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
 197                          array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
 198                          array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
 199                         );
 200  
 201  // check if a default currency is set

 202    if (!defined('DEFAULT_CURRENCY')) {
 203      $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
 204    }
 205  
 206  // check if a default language is set

 207    if (!defined('DEFAULT_LANGUAGE')) {
 208      $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
 209    }
 210  
 211    if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
 212      $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
 213    }
 214  
 215  // BOF: MOD - Admin w/access levels

 216    if (basename($_SERVER['SCRIPT_FILENAME']) != FILENAME_LOGIN && basename($_SERVER['SCRIPT_FILENAME']) != FILENAME_PASSWORD_FORGOTTEN && basename($_SERVER['SCRIPT_FILENAME']) != FILENAME_FORBIDDEN) {
 217      tep_admin_check_login();
 218    }
 219  // EOF: MOD - Admin w/access levels

 220  
 221  // LINE ADDED: MOD - OSC-AFFILIATE

 222    require ('includes/affiliate_application_top.php');
 223  
 224  // LINE ADDED: MOD - CREDIT CLASS Gift Voucher Contribution

 225    require (DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php');
 226    
 227  // LINE ADDED: MOD - articles functions

 228    require (DIR_WS_FUNCTIONS . 'articles.php');
 229  
 230  // BOF: MOD - Article Manager

 231    if (isset($HTTP_GET_VARS['tPath'])) {
 232      $tPath = $HTTP_GET_VARS['tPath'];
 233    } else {
 234      $tPath = '';
 235    }
 236  
 237    if (tep_not_null($tPath)) {
 238      $tPath_array = tep_parse_topic_path($tPath);
 239      $tPath = implode('_', $tPath_array);
 240      $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
 241    } else {
 242      $current_topic_id = 0;
 243    }
 244  // EOF: MOD - Article Manager

 245  
 246  // BOF: FedEx Labels

 247    define('DIR_WS_FEDEX_LABELS', DIR_WS_IMAGES . 'fedex/');
 248  // EOF: FedEx Labels

 249  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7