Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Admin Password Help Please


Guest

Recommended Posts

I have only being using oscommerce for 2 days and all has been going fine. However I tried to use the admin_authen_2.2CVS tool today to place a password on my admin section. For some reason this has caused me a big problem. I have put all the files that I ammended back as they were but I still recieve this error when trying to get into the admin section

 

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'mysql@localhost' (Using password: NO) in /home/www/deignerc/catalog/admin/includes/functions/database.php on line 19

Unable to connect to database server!

 

Could anyone please point me in the right direction.

 

 

Many thanks

Link to comment
Share on other sites

I'm not the expert myself,

 

but to me that looks more like you have problems connecting to your mysql database. Had those also a few times before because I accidentally replaced one of the "configure.php" files with a default one that didn't have all the passwords etc in it...

 

maybe worth checking that...

Good luck!

 

DicE

_____.:::.________###__________|/______

:(o o): . (o o) (o o)

ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-

Link to comment
Share on other sites

Ah, I thought I had fixed it. I can now get into the admin screen, however I am unable to do any admin as every item I click on gives me a "page not found error"

 

Any more ideas please??

Link to comment
Share on other sites

I may be wrong but it sounds like you overwrote your configure.php in admin includes when you restored the original files - you obviously changed the MySQL login details but you need to change the paths in this file in order to tell admin where to find everything.

 

If catalog is working then a clue to the correct settings will be in catalog/includes/configure.php.

 

Alternatively - run the install again if it worked for you the first time but don't forget to export your MySQL database first so you can restore it afterwards. The install routine re-initialises the database and creates the sample Oscommerce data

Link to comment
Share on other sites

OK. Here are the contents of both files:

 

config.php:-

 

define('HTTP_SERVER', 'http://www.designerclothes4u.com'); // eg, http://localhost or - https://localhost should not be NULL for productive servers

define('HTTP_CATALOG_SERVER', 'http://www.designerclothes4u.com');

define('HTTPS_CATALOG_SERVER', 'https://www.designerclothes4u.com');

define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

define('DIR_FS_DOCUMENT_ROOT', '/home/www/hosts/www.designerclothes4u.com'); // where the pages are located on the server

define('DIR_WS_ADMIN', '/home/www/hosts/www.designerclothes4u.com/admin/'); // absolute path required

define('DIR_FS_ADMIN', '/home/www/hosts/www.designerclothes4u.com/admin/'); // absolute pate required

define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

define('DIR_FS_CATALOG', '/home/www/hosts/www.designerclothes4u.com/catalog/'); // absolute path required

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

// define our database connection

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', '*******');

define('DB_SERVER_PASSWORD', '*******');

define('DB_DATABASE', '*******');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

?>

 

 

application_top.php:-

 

 

<?php

/*

$Id: application_top.php,v 1.154 2003/02/07 21:46:48 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 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 if register_globals is enabled.

// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.

if (function_exists('ini_get')) {

ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');

}

 

// Disable use_trans_sid as tep_href_link() does this manually

if (function_exists('ini_set')) {

ini_set('session.use_trans_sid', 0);

}

 

// 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', 'Preview Release 2.2-CVS');

 

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

 

// define the filenames used in the project

define('FILENAME_BACKUP', 'backup.php');

define('FILENAME_BANNER_MANAGER', 'banner_manager.php');

define('FILENAME_BANNER_STATISTICS', 'banner_statistics.php');

define('FILENAME_CACHE', 'cache.php');

define('FILENAME_CATALOG_ACCOUNT_HISTORY_INFO', 'account_history_info.php');

define('FILENAME_CATEGORIES', 'categories.php');

define('FILENAME_CONFIGURATION', 'configuration.php');

define('FILENAME_COUNTRIES', 'countries.php');

define('FILENAME_CURRENCIES', 'currencies.php');

define('FILENAME_CUSTOMERS', 'customers.php');

define('FILENAME_DEFAULT', 'index.php');

define('FILENAME_DEFINE_LANGUAGE', 'define_language.php');

define('FILENAME_FILE_MANAGER', 'file_manager.php');

define('FILENAME_GEO_ZONES', 'geo_zones.php');

define('FILENAME_LANGUAGES', 'languages.php');

define('FILENAME_MAIL', 'mail.php');

define('FILENAME_MANUFACTURERS', 'manufacturers.php');

define('FILENAME_MODULES', 'modules.php');

define('FILENAME_NEWSLETTERS', 'newsletters.php');

define('FILENAME_ORDERS', 'orders.php');

define('FILENAME_ORDERS_INVOICE', 'invoice.php');

define('FILENAME_ORDERS_PACKINGSLIP', 'packingslip.php');

define('FILENAME_ORDERS_STATUS', 'orders_status.php');

define('FILENAME_POPUP_IMAGE', 'popup_image.php');

define('FILENAME_PRODUCTS_ATTRIBUTES', 'products_attributes.php');

define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php');

define('FILENAME_REVIEWS', 'reviews.php');

define('FILENAME_SERVER_INFO', 'server_info.php');

define('FILENAME_SHIPPING_MODULES', 'shipping_modules.php');

define('FILENAME_SPECIALS', 'specials.php');

define('FILENAME_STATS_CUSTOMERS', 'stats_customers.php');

define('FILENAME_STATS_PRODUCTS_PURCHASED', 'stats_products_purchased.php');

define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');

define('FILENAME_TAX_CLASSES', 'tax_classes.php');

define('FILENAME_TAX_RATES', 'tax_rates.php');

define('FILENAME_WHOS_ONLINE', 'whos_online.php');

define('FILENAME_ZONES', 'zones.php');

 

// define the database table names used in the project

define('TABLE_ADDRESS_BOOK', 'address_book');

define('TABLE_ADDRESS_FORMAT', 'address_format');

define('TABLE_BANNERS', 'banners');

define('TABLE_BANNERS_HISTORY', 'banners_history');

define('TABLE_CATEGORIES', 'categories');

define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');

define('TABLE_CONFIGURATION', 'configuration');

define('TABLE_CONFIGURATION_GROUP', 'configuration_group');

define('TABLE_COUNTRIES', 'countries');

define('TABLE_CURRENCIES', 'currencies');

define('TABLE_CUSTOMERS', 'customers');

define('TABLE_CUSTOMERS_BASKET', 'customers_basket');

define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');

define('TABLE_CUSTOMERS_INFO', 'customers_info');

define('TABLE_LANGUAGES', 'languages');

define('TABLE_MANUFACTURERS', 'manufacturers');

define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');

define('TABLE_NEWSLETTERS', 'newsletters');

define('TABLE_ORDERS', 'orders');

define('TABLE_ORDERS_PRODUCTS', 'orders_products');

define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');

define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');

define('TABLE_ORDERS_STATUS', 'orders_status');

define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');

define('TABLE_ORDERS_TOTAL', 'orders_total');

define('TABLE_PRODUCTS', 'products');

define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');

define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');

define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');

define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');

define('TABLE_PRODUCTS_OPTIONS', 'products_options');

define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');

define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');

define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');

define('TABLE_REVIEWS', 'reviews');

define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');

define('TABLE_SESSIONS', 'sessions');

define('TABLE_SPECIALS', 'specials');

define('TABLE_TAX_CLASS', 'tax_class');

define('TABLE_TAX_RATES', 'tax_rates');

define('TABLE_GEO_ZONES', 'geo_zones');

define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');

define('TABLE_WHOS_ONLINE', 'whos_online');

define('TABLE_ZONES', 'zones');

 

// 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']);

}

 

// initialize the logger class

require(DIR_WS_CLASSES . 'logger.php');

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.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', 'sID');

define('PHP_SESSION_SAVE_PATH', '/tmp');

 

include(DIR_WS_CLASSES . 'sessions.php');

}

 

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

tep_session_name('osCAdminsID');

 

// lets start our session

tep_session_start();

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, substr(DIR_WS_ADMIN, 0, -1));

}

 

// language

require(DIR_WS_FUNCTIONS . 'languages.php');

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

if (!$language) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

$language = tep_get_languages_directory($HTTP_GET_VARS['language']);

if (!$language) $language = tep_get_languages_directory(DEFAULT_LANGUAGE);

}

 

// include the language translations

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

$current_page = split('?', basename($PHP_SELF)); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility

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

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

}

 

// define our general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

// define our localization functions

require(DIR_WS_FUNCTIONS . 'localization.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');

 

// calculate category path

$cPath = $HTTP_GET_VARS['cPath'];

if (strlen($cPath) > 0) {

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

$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 ($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');

}

?>

Link to comment
Share on other sites

If you have SSL you should set

 

define('ENABLE_SSL_CATALOG', true); // secure webserver for catalog module

 

 

Are you sure that you renamed default.php ? in both includes or did you overwrite them?

 

is this the configuration of /admin/includes/config ?

 

Good luck

Link to comment
Share on other sites

Thanks for the quick reply. I am not using SSL so that is OKas it is. I did just notice that line

 

define('DIR_WS_ADMIN', '/home/www/hosts/www.designerclothes4u.com/admin/'); // absolute path required

 

was incorrect and have no changed it to read

 

define('DIR_WS_ADMIN', '/admin/'); // absolute path required

 

This has stopped a very long URL being shown when hovering over a hyperlink on the admin panel.

 

 

 

Are you sure that you renamed default.php ? in both includes or did you overwrite them?

 

I'm not sure what you mean by that question? When the Authentication module didn't work for me I replaced the files that I had changed ie /admin/includes/configure.php & /admin/includes/application_top.php with the default ones.

 

is this the configuration of /admin/includes/config ?

 

This is the configuration of /admin/includes/configuration.php

 

 

Many thanks again

Link to comment
Share on other sites

You can setup a password to your Admin through your ISP'S contol panel OR you can do it through an .htaccess & .htpsswrd files which there are instructions here on the forum for that!! The ISP CONTROL PANEL is MUCH easier, the other one looks a little complicated, but there are good posts on it!!

 

Good luck!

Jay

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...