PageRenderTime 77ms CodeModel.GetById 30ms app.highlight 28ms RepoModel.GetById 12ms app.codeStats 1ms

/oscommerce-2.2rc2/includes/application_top.php

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