Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

made security changes, now what does this mean?


petevannuys

Recommended Posts

Where "Bob" is the re-named /admin file, what does this mean?

 

Parse error: syntax error, unexpected $end in /home1/urbanbic/public_html/catalog/Bob/includes/application_top.php on line 237

 

I did a copy/paste on line 146 in the code from Jan Zonjee's post July 18 '09. That's all, honest.

 

And line 237 in the file looks like this:

 

234 if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {

235 $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');

236 }

237 ?>

 

How do I fix this?

Link to comment
Share on other sites

That error usually means you have unequal or incorrectly nested curly braces ( { } ) in the active code.

 

You just have to find the problem and correct it.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

That error usually means you have unequal or incorrectly nested curly braces ( { } ) in the active code.

 

You just have to find the problem and correct it.

 

Germ, hi.

 

Opened the file in Dreamweaver and couldn't find the problem; DW may not be the best php editor.

What else could be wrong to give that msgs?

And what editor do you recommend... that's free?

I don't "do" .php so Notepad doesn't help much.

 

Thanks.

Link to comment
Share on other sites

I use Crimson editor (it's free - g00gle it)

 

When used correctly it will help find problems like this.

 

If you post the entire file I'll help you find the problem.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Germ, hi.

Here's the application_top.php file that throws the error.

sorry, I can't figure out how to get the line#s, too.

--------------------------

<?php

/*

$Id: application_top.php 1785 2008-01-10 15:07:07Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

 

// Start the clock for the page parse time log

define('PAGE_PARSE_START_TIME', microtime());

 

// Set the level of error reporting

error_reporting(E_ALL & ~E_NOTICE);

 

// check support for register_globals

if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {

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.');

}

 

// Set the local configuration parameters - mainly for developers

if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

 

// Include application configuration parameters

require('includes/configure.php');

 

// Define the project version

define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// set php_self in the local scope

$PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

 

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

 

// customization for the design layout

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

 

// Define how do we update currency exchange rates

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

define('CURRENCY_SERVER_PRIMARY', 'oanda');

define('CURRENCY_SERVER_BACKUP', 'xe');

 

// include the database functions

require(DIR_WS_FUNCTIONS . 'database.php');

 

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

// set application wide parameters

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while ($configuration = tep_db_fetch_array($configuration_query)) {

define($configuration['cfgKey'], $configuration['cfgValue']);

}

 

// define our general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

// initialize the logger class

require(DIR_WS_CLASSES . 'logger.php');

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// check to see if php implemented session management functions - if not, include php3/php4 compatible session class

if (!function_exists('session_start')) {

define('PHP_SESSION_NAME', 'osCAdminID');

define('PHP_SESSION_PATH', '/');

define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

 

include(DIR_WS_CLASSES . 'sessions.php');

}

 

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

// set the session name and save path

tep_session_name('osCAdminID');

tep_session_save_path(SESSION_WRITE_DIRECTORY);

 

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, DIR_WS_ADMIN);

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', DIR_WS_ADMIN);

}

 

// lets start our session

tep_session_start();

 

if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {

extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);

}

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// redirect to login page if administrator is not yet logged in

if (!tep_session_is_registered('admin')) {

$redirect = false;

 

$current_page = basename($PHP_SELF);

 

if ($current_page != FILENAME_LOGIN) {

if (!tep_session_is_registered('redirect_origin')) {

tep_session_register('redirect_origin');

 

$redirect_origin = array('page' => $current_page,

'get' => $HTTP_GET_VARS);

}

 

$redirect = true;

}

 

if (!isset($login_request) || isset($HTTP_GET_VARS['login_request']) || isset($HTTP_POST_VARS['login_request']) || isset($HTTP_COOKIE_VARS['login_request']) || isset($HTTP_SESSION_VARS['login_request']) || isset($HTTP_POST_FILES['login_request']) || isset($HTTP_SERVER_VARS['login_request'])) {

$redirect = true;

}

 

if ($redirect == true) {

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

 

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

$current_page = basename($PHP_SELF);

if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {

include(DIR_WS_LANGUAGES . $language . '/' . $current_page);

}

 

// define our localization functions

require(DIR_WS_FUNCTIONS . 'localization.php');

 

// Include validation functions (right now only email address)

require(DIR_WS_FUNCTIONS . 'validations.php');

 

// setup our boxes

require(DIR_WS_CLASSES . 'table_block.php');

require(DIR_WS_CLASSES . 'box.php');

 

// initialize the message stack for output messages

require(DIR_WS_CLASSES . 'message_stack.php');

$messageStack = new messageStack;

 

// split-page-results

require(DIR_WS_CLASSES . 'split_page_results.php');

 

// entry/item info classes

require(DIR_WS_CLASSES . 'object_info.php');

 

// email classes

require(DIR_WS_CLASSES . 'mime.php');

require(DIR_WS_CLASSES . 'email.php');

 

// file uploading class

require(DIR_WS_CLASSES . 'upload.php');

 

// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} else {

$cPath = '';

}

 

if (tep_not_null($cPath)) {

$cPath_array = tep_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];

} else {

$current_category_id = 0;

}

 

// default open navigation box

if (!tep_session_is_registered('selected_box')) {

tep_session_register('selected_box');

$selected_box = 'configuration';

}

 

if (isset($HTTP_GET_VARS['selected_box'])) {

$selected_box = $HTTP_GET_VARS['selected_box'];

}

 

// the following cache blocks are used in the Tools->Cache section

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

$cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),

array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),

array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)

);

 

// check if a default currency is set

if (!defined('DEFAULT_CURRENCY')) {

$messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');

}

 

// check if a default language is set

if (!defined('DEFAULT_LANGUAGE')) {

$messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');

}

 

if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {

$messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');

}

?>

Link to comment
Share on other sites

I'll need ALL the code from /catalog/Bob/includes/application_top.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Germ, hi.

Here's the application_top.php file that throws the error.

sorry, I can't figure out how to get the line#s, too.

--------------------------

<?php

/*

$Id: application_top.php 1785 2008-01-10 15:07:07Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

 

// Start the clock for the page parse time log

define('PAGE_PARSE_START_TIME', microtime());

 

// Set the level of error reporting

error_reporting(E_ALL & ~E_NOTICE);

 

// check support for register_globals

if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {

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.');

}

 

// Set the local configuration parameters - mainly for developers

if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

 

// Include application configuration parameters

require('includes/configure.php');

 

// Define the project version

define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// set php_self in the local scope

$PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

 

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

 

// customization for the design layout

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

 

// Define how do we update currency exchange rates

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

define('CURRENCY_SERVER_PRIMARY', 'oanda');

define('CURRENCY_SERVER_BACKUP', 'xe');

 

// include the database functions

require(DIR_WS_FUNCTIONS . 'database.php');

 

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

// set application wide parameters

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while ($configuration = tep_db_fetch_array($configuration_query)) {

define($configuration['cfgKey'], $configuration['cfgValue']);

}

 

// define our general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

// initialize the logger class

require(DIR_WS_CLASSES . 'logger.php');

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// check to see if php implemented session management functions - if not, include php3/php4 compatible session class

if (!function_exists('session_start')) {

define('PHP_SESSION_NAME', 'osCAdminID');

define('PHP_SESSION_PATH', '/');

define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

 

include(DIR_WS_CLASSES . 'sessions.php');

}

 

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

// set the session name and save path

tep_session_name('osCAdminID');

tep_session_save_path(SESSION_WRITE_DIRECTORY);

 

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, DIR_WS_ADMIN);

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', DIR_WS_ADMIN);

}

 

// lets start our session

tep_session_start();

 

if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {

extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);

}

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// redirect to login page if administrator is not yet logged in

if (!tep_session_is_registered('admin')) {

$redirect = false;

 

$current_page = basename($PHP_SELF);

 

if ($current_page != FILENAME_LOGIN) {

if (!tep_session_is_registered('redirect_origin')) {

tep_session_register('redirect_origin');

 

$redirect_origin = array('page' => $current_page,

'get' => $HTTP_GET_VARS);

//========= pasted here per Jan's post ===========> }

 

$redirect = true;

}

 

if (!isset($login_request) || isset($HTTP_GET_VARS['login_request']) || isset($HTTP_POST_VARS['login_request']) || isset($HTTP_COOKIE_VARS['login_request']) || isset($HTTP_SESSION_VARS['login_request']) || isset($HTTP_POST_FILES['login_request']) || isset($HTTP_SERVER_VARS['login_request'])) {

$redirect = true;

}

//<=============== to about here================

if ($redirect == true) {

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

 

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

$current_page = basename($PHP_SELF);

if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {

include(DIR_WS_LANGUAGES . $language . '/' . $current_page);

}

 

// define our localization functions

require(DIR_WS_FUNCTIONS . 'localization.php');

 

// Include validation functions (right now only email address)

require(DIR_WS_FUNCTIONS . 'validations.php');

 

// setup our boxes

require(DIR_WS_CLASSES . 'table_block.php');

require(DIR_WS_CLASSES . 'box.php');

 

// initialize the message stack for output messages

require(DIR_WS_CLASSES . 'message_stack.php');

$messageStack = new messageStack;

 

// split-page-results

require(DIR_WS_CLASSES . 'split_page_results.php');

 

// entry/item info classes

require(DIR_WS_CLASSES . 'object_info.php');

 

// email classes

require(DIR_WS_CLASSES . 'mime.php');

require(DIR_WS_CLASSES . 'email.php');

 

// file uploading class

require(DIR_WS_CLASSES . 'upload.php');

 

// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} else {

$cPath = '';

}

 

if (tep_not_null($cPath)) {

$cPath_array = tep_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];

} else {

$current_category_id = 0;

}

 

// default open navigation box

if (!tep_session_is_registered('selected_box')) {

tep_session_register('selected_box');

$selected_box = 'configuration';

}

 

if (isset($HTTP_GET_VARS['selected_box'])) {

$selected_box = $HTTP_GET_VARS['selected_box'];

}

 

// the following cache blocks are used in the Tools->Cache section

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

$cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),

array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),

array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)

);

 

// check if a default currency is set

if (!defined('DEFAULT_CURRENCY')) {

$messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');

}

 

// check if a default language is set

if (!defined('DEFAULT_LANGUAGE')) {

$messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');

}

 

if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {

$messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');

}

?>

Link to comment
Share on other sites

<?php
/*
 $Id: application_top.php 1785 2008-01-10 15:07:07Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/

// Start the clock for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// check support for register_globals
 if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {
   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.');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// Include application configuration parameters
 require('includes/configure.php');

// Define the project version
 define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// set php_self in the local scope
 $PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

// Used in the "Backup Manager" to compress backups
 define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
 define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
 define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
 define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

// Define how do we update currency exchange rates
// Possible values are 'oanda' 'xe' or ''
 define('CURRENCY_SERVER_PRIMARY', 'oanda');
 define('CURRENCY_SERVER_BACKUP', 'xe');

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set application wide parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// define our general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// initialize the logger class
 require(DIR_WS_CLASSES . 'logger.php');

// include shopping cart class
 require(DIR_WS_CLASSES . 'shopping_cart.php');

// check to see if php implemented session management functions - if not, include php3/php4 compatible session class
 if (!function_exists('session_start')) {
   define('PHP_SESSION_NAME', 'osCAdminID');
   define('PHP_SESSION_PATH', '/');
   define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

   include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCAdminID');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
   session_set_cookie_params(0, DIR_WS_ADMIN);
 } elseif (function_exists('ini_set')) {
   ini_set('session.cookie_lifetime', '0');
   ini_set('session.cookie_path', DIR_WS_ADMIN);
 }

// lets start our session
 tep_session_start();

 if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
   extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
 }

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// redirect to login page if administrator is not yet logged in
 if (!tep_session_is_registered('admin')) {
   $redirect = false;

   $current_page = basename($PHP_SELF);

   if ($current_page != FILENAME_LOGIN) {
     if (!tep_session_is_registered('redirect_origin')) {
       tep_session_register('redirect_origin');

       $redirect_origin = array('page' => $current_page,
                                'get' => $HTTP_GET_VARS);
     }

   $redirect = true;
   }

   if (!isset($login_request) || isset($HTTP_GET_VARS['login_request']) || isset($HTTP_POST_VARS['login_request']) || isset($HTTP_COOKIE_VARS['login_request']) || isset($HTTP_SESSION_VARS['login_request']) || isset($HTTP_POST_FILES['login_request']) || isset($HTTP_SERVER_VARS['login_request'])) {
   $redirect = true;
   }

   if ($redirect == true) {
     tep_redirect(tep_href_link(FILENAME_LOGIN));
   }

 } // <-- I added this line


// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');
 $current_page = basename($PHP_SELF);
 if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
   include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
 }

// define our localization functions
 require(DIR_WS_FUNCTIONS . 'localization.php');

// Include validation functions (right now only email address)
 require(DIR_WS_FUNCTIONS . 'validations.php');

// setup our boxes
 require(DIR_WS_CLASSES . 'table_block.php');
 require(DIR_WS_CLASSES . 'box.php');

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// split-page-results
 require(DIR_WS_CLASSES . 'split_page_results.php');

// entry/item info classes
 require(DIR_WS_CLASSES . 'object_info.php');

// email classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

// file uploading class
 require(DIR_WS_CLASSES . 'upload.php');

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
   $cPath = $HTTP_GET_VARS['cPath'];
 } else {
   $cPath = '';
 }

 if (tep_not_null($cPath)) {
   $cPath_array = tep_parse_category_path($cPath);
   $cPath = implode('_', $cPath_array);
   $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 } else {
   $current_category_id = 0;
 }

// default open navigation box
 if (!tep_session_is_registered('selected_box')) {
   tep_session_register('selected_box');
   $selected_box = 'configuration';
 }

 if (isset($HTTP_GET_VARS['selected_box'])) {
   $selected_box = $HTTP_GET_VARS['selected_box'];
 }

// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
 $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
                      );

// check if a default currency is set
 if (!defined('DEFAULT_CURRENCY')) {
   $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
 }

// check if a default language is set
 if (!defined('DEFAULT_LANGUAGE')) {
   $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
 }

 if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
   $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
 }
?>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The only thing I changed in the code was this:

 

  } // <-- I added this line

 

Look for it.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Whatever it takes to get that line in there.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Pasted and saved the file.

Them tried to log in....

 

Google Chrome says:

This webpage has a redirect loop.

 

The webpage at http://www.urbanbicycleoutfitters.com/catalog/"Bob"/login.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

 

Here are some suggestions:

Reload this web page later.

Learn more about this problem.

 

Of course, Firef gives a similar [choke].

Is there something hinky in Jan's code? I also made the corresponding changes in two other lines in other files...

Link to comment
Share on other sites

The parse error I can fix.

 

I really wouldn't know where to begin on that one.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The webpage at www.urbanbicycleoutfitters.com/catalog/"Bob"/login.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

I don't see an osCommerce site, I see a Wordpress blog (with it's own .htaccess and SEO url's probably). :huh:

Link to comment
Share on other sites

www.urbanbicycleoutfitters.com/catalog

 

Displays an osc shop

 

Suspect the problem should be the /"Bob"/ but removing the "

 

www.urbanbicycleoutfitters.com/catalog/Bob/login.php

 

Does not go to the admin.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

www.urbanbicycleoutfitters.com/catalog

 

Displays an osc shop

But I still think it is plausiible that the .htaccess of a Wordpress installation nterfereing with the osC installation/admin side is the cause of the redirects.

 

You could try the direct url of the admin login to which you are redirected: www.urbanbicycleoutfitters.com/catalog/"Bob"/login.php

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...