Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't log in to Admin section


Redheadskater

Recommended Posts

Posted

My host recently upgraded to php5 and so I was forced into upgrading my client's store to v2.2 rc2a. I've been at it all day.

 

There is one issue I have been working on for 4 hours now. I can not figure out what the problem is. Every time I try to log into the admin panel, it gives me a "invalid administrator login attempt".

 

 

After scouring the message boards, two things kept coming up at me: the db setting in the admin/includes/configure.php file and .htaccess.

 

I logged into PHPmyadmin just to double check that in the Administrators table, it says "admin" and "password" in the appropriate fields.

 

I am royally stumped.

 

Here's my admin/includes/configure.php file in it's entirety:

 

<?php
/*
 $Id: configure.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

// define our webserver variables
// FS = Filesystem (physical)
// WS = Webserver (virtual)
 define('HTTP_SERVER', 'http://www.store.com/admin/'); // eg, http://localhost or - https://localhost should not be NULL for productive servers
 define('HTTP_CATALOG_SERVER', 'http://www.store.com');
 define('HTTPS_CATALOG_SERVER', 'http://www.store.com');
 define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)
 define('DIR_WS_ADMIN', '');
 define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
 define('DIR_WS_CATALOG', '/');
 define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
 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', 'name');
 define('DB_SERVER_PASSWORD', 'password');
 define('DB_DATABASE', 'dbname');
 define('USE_PCONNECT', 'false');
 define('STORE_SESSIONS', 'mysql');
?>

 

:blink:

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted
My host recently upgraded to php5 and so I was forced into upgrading my client's store to v2.2 rc2a. I've been at it all day.

 

There is one issue I have been working on for 4 hours now. I can not figure out what the problem is. Every time I try to log into the admin panel, it gives me a "invalid administrator login attempt".

 

 

After scouring the message boards, two things kept coming up at me: the db setting in the admin/includes/configure.php file and .htaccess.

 

I logged into PHPmyadmin just to double check that in the Administrators table, it says "admin" and "password" in the appropriate fields.

 

I am royally stumped.

 

Here's my admin/includes/configure.php file in it's entirety:

 

<?php
/*
  $Id: configure.php 1739 2007-12-20 00:52:16Z hpdl $

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

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

// define our webserver variables
// FS = Filesystem (physical)
// WS = Webserver (virtual)
  define('HTTP_SERVER', 'http://www.store.com/admin/'); // eg, http://localhost or - https://localhost should not be NULL for productive servers
  define('HTTP_CATALOG_SERVER', 'http://www.store.com');
  define('HTTPS_CATALOG_SERVER', 'http://www.store.com');
  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
  define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)
  define('DIR_WS_ADMIN', '');
  define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
  define('DIR_WS_CATALOG', '/');
  define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
  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', 'name');
  define('DB_SERVER_PASSWORD', 'password');
  define('DB_DATABASE', 'dbname');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'mysql');
?>

 

:blink:

 

add your db name your user name and your password to the following lines

 

define('DB_SERVER_USERNAME', 'name');

define('DB_SERVER_PASSWORD', 'password');

define('DB_DATABASE', 'dbname');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

 

 

w/e user names you used in your cpanel to make the database

Weather you think you can, or you think you can't. Your right.

Posted

I assume you have changed the contents of that configure.php file before posting - otherwise, do as the previous poster suggests.

 

My host recently upgraded to php5 and so I was forced into upgrading my client's store to v2.2 rc2a. I've been at it all day.

 

It wasn't strictly necessary to upgrade to RC2a in order to get "5" compatibility. It would have been about 30 minutes work to change some SQL stuff and a few pieces of code in your original MS2? Store. But that doesn't really help you now - might help people in the future who find this thread though.

 

If you had an older version of osCommerce, the Admin area woud have been secured using .htaccess - this, presumably, is still in place and you are able to get past this. RC now has a "login" page asking for username and password. I'm guessing that you are struggling to get past this page?

 

Make sure you are using the correct password - usually case sensitive. Still doesn't work, it's time to try a new password;

 

Open up PHPMyAdmin and select your administrators table. Edit the admin record and change the password. Just type this into the "user_password" box:

 

6cdd7c57450225fac77427f5962bb726:40

 

and then press update or go - to update the record.

 

The password for this is "pass" (without quotes). Or, at least, it is on my test server. Now try to login - hopefully it will work. You might want to copy your existing password, just in case it doesn't ;)

 

If you are logged in, go straight to your administrators page and change the password to something that is easy to remember and harder for someone to guess.

 

Good luck.

Posted

You say you "UPGRADED" to RC2a but do you mean that you upgraded your MS2.2 files? or do you mean that you imported your DB into a fresh RC2a?

 

How did you add the admin user/password to the DB?

 

Do you have the file catalog/admin/includes/functions/password_funcs?

Posted
add your db name your user name and your password to the following lines

 

define('DB_SERVER_USERNAME', 'name');

define('DB_SERVER_PASSWORD', 'password');

define('DB_DATABASE', 'dbname');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

w/e user names you used in your cpanel to make the database

 

 

Yes, they are there. For security reasons, I did not post them here.

 

:)

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted
I assume you have changed the contents of that configure.php file before posting - otherwise, do as the previous poster suggests.

 

Yes, I did change the contents for security reasons. But I have already tried copying/pasting my db settings from the catalog/includes/configure.php file because I can see the frontend of the site just fine. You can login, create a new account and order just fine.

 

 

If you had an older version of osCommerce, the Admin area woud have been secured using .htaccess - this, presumably, is still in place and you are able to get past this. RC now has a "login" page asking for username and password. I'm guessing that you are struggling to get past this page?

 

I took off the password protection when I realized there is now a login page to get to the admin section. That is one of the first things I did as I really thought it was the issue. So yes, I am struggling to get past the login.php page.

 

 

Make sure you are using the correct password - usually case sensitive. Still doesn't work, it's time to try a new password;

 

Open up PHPMyAdmin and select your administrators table. Edit the admin record and change the password. Just type this into the "user_password" box:

 

6cdd7c57450225fac77427f5962bb726:40

 

and then press update or go - to update the record.

 

The password for this is "pass" (without quotes). Or, at least, it is on my test server. Now try to login - hopefully it will work. You might want to copy your existing password, just in case it doesn't ;)

 

I tried this too, and it still doesn't work! :'(

 

Here's the new message I'm getting:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mediredi_admin'@'localhost' (using password: YES) in /home/mediredi/public_html/admin/includes/functions/database.php on line 19

Unable to connect to database server!

 

I even went into Cpanel and created a new db user, assigned it to my OS database and changed the config file - that didn't work either.

 

Sigh.......

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted
You say you "UPGRADED" to RC2a but do you mean that you upgraded your MS2.2 files? or do you mean that you imported your DB into a fresh RC2a?

 

How did you add the admin user/password to the DB?

 

Do you have the file catalog/admin/includes/functions/password_funcs?

 

 

It was an upgrade. I downloaded the 2.2 rc2a.zip file, read the documentation there and proceeded to make the changes to the files as indicated. I took the edits to the datbase, put them in a text file and imported it into the db. I received no error messages.

 

I checked for the password_funcs file and it is there.

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted

That error is because you are using incorrect details in configure.php and so the pages cannot find the database.

 

Make sure that your configure.php is correct and then try the password I gave you again. It _should_ work (in theory).

 

If the catalog is wokring OK, make sure that the db settings in admin/includes/configure.php match exactly the db settings in /includes/configure.php

 

Also make sure that in PHPMyAdmin you have the password exactly as I pasted it (make sure that you don't have any blank space on the end of it and so on).

 

If all else fails, and you want to trust someone to try to fix it, PM me your FTP details and your PHPmYAdmin access - I'll have a go for you.

Posted
That error is because you are using incorrect details in configure.php and so the pages cannot find the database.

 

Make sure that your configure.php is correct and then try the password I gave you again. It _should_ work (in theory).

 

 

Don't you think it's odd, though, that I didn't change anything in my config file except for the password? If there was something wrong with my settings for the pages in the config file, I would have gotten an error message no matter what my db settings were. Right?

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted

Sorry I was on the wrong track here for some odd reason I was talking about the admin login system of RC1/2/2a whereas you are talking about simply logging into your DB.

 

Having said that .. I don't suppose you've uploaded the FULL RC2a application_top.php have you? the one that REQUIRES admin to log in.

Posted

I don't completely understand why you've changed the password to your database in your config file?

 

You might have misunderstood my post above? I meant you need to change the password in the administrators table of your database...

Posted
I don't completely understand why you've changed the password to your database in your config file?

 

You might have misunderstood my post above? I meant you need to change the password in the administrators table of your database...

 

 

LOL!! Now I'm getting confused.

 

Yes, I changed the password in the administrators table of the db. I then went into the config file and changed the pw there too, because they need to match in order to log in.

 

At least that's the way I've always understood it!

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted
LOL!! Now I'm getting confused.

 

Yes, I changed the password in the administrators table of the db. I then went into the config file and changed the pw there too, because they need to match in order to log in.

 

At least that's the way I've always understood it!

 

You understood wrong ;)

 

The pass in the configure is the password for the Database only.

 

The pass for the admin section is just a password to let you, the admin, into the admin area.

 

Probably if you change the configure file to the correct password (that's the PW for the database!), it all might just work ;)

 

I replied to your PM.

Posted
Sorry I was on the wrong track here for some odd reason I was talking about the admin login system of RC1/2/2a whereas you are talking about simply logging into your DB.

 

Having said that .. I don't suppose you've uploaded the FULL RC2a application_top.php have you? the one that REQUIRES admin to log in.

 

 

No, you were thinking correctly. I am simply trying to log into the admin section. Burt explained to me that the db password in the config file and the admin password in the administrators table in the db are 2 different things! I thought they were one of the same.

 

Yes, I took the new application_top from the zip file and uploaded to the server.

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

Posted

Ok, now that Burt has helped to get me un-confused :)

 

What happened is that I was hard-coding my password in the Administrators table and then putting that password in the admin/includes/configure.php file, thinking that the two passwords needed to match.

 

So by going back into to the Administrators table, changing the password to the encrypted version Burt posted - and leaving the password in the config file to the db password, I was able to log in to the admin section just fine.

 

So essentially, I was thinking that the db password and the admin password were one of the same.

 

I stand corrected!

 

Thanks to all who replied.

"You can't be a smart cookie if you have a crummy attitude." - John Maxwell

  • 2 months later...
Posted
I assume you have changed the contents of that configure.php file before posting - otherwise, do as the previous poster suggests.

It wasn't strictly necessary to upgrade to RC2a in order to get "5" compatibility. It would have been about 30 minutes work to change some SQL stuff and a few pieces of code in your original MS2? Store. But that doesn't really help you now - might help people in the future who find this thread though.

 

If you had an older version of osCommerce, the Admin area woud have been secured using .htaccess - this, presumably, is still in place and you are able to get past this. RC now has a "login" page asking for username and password. I'm guessing that you are struggling to get past this page?

 

Make sure you are using the correct password - usually case sensitive. Still doesn't work, it's time to try a new password;

 

Open up PHPMyAdmin and select your administrators table. Edit the admin record and change the password. Just type this into the "user_password" box:

 

6cdd7c57450225fac77427f5962bb726:40

 

and then press update or go - to update the record.

 

The password for this is "pass" (without quotes). Or, at least, it is on my test server. Now try to login - hopefully it will work. You might want to copy your existing password, just in case it doesn't ;)

 

If you are logged in, go straight to your administrators page and change the password to something that is easy to remember and harder for someone to guess.

 

Good luck.

I am looking for the administrators table in my osc2 db and I can't find it. What am I missing in trying to find it?

 

Thanks in advance,

Cathy s

  • 4 months later...
Posted
I am looking for the administrators table in my osc2 db and I can't find it. What am I missing in trying to find it?

 

Thanks in advance,

Cathy s

Firstly, a big thanks to Burt for the encrypted password! You saved me a headache, as it works a treat if you get locked out your admin.

 

Cathy,

From your Control Panel open phpMyAdmin and open your database. Click on the admin table in the left column. If there is one entry, it is your admin id. Edit admin_password and you will be able to login to your admin using your email address and the new password.

  • 3 weeks later...
Posted

Hi,

 

I'm also having problems logging in. I can't find Admin in the DB, using PHPMyAdmin. My DB starts with:

address_book

address_format

banners

banners_history

categories

....

 

 

Any ideas?

Posted

I have no 'admin' table in my SQL database. Where would I find the administrator's login for the catalog/admin section ?

Posted
I have no 'admin' table in my SQL database. Where would I find the administrator's login for the catalog/admin section ?

If you don't have an admin login screen, it means you're using a version of oscommerce prior to RC1 release.

 

You may want to use htaccess or password protect your admin directory through your web host control panel.

 

Search the contribution secton for addons regarding login for admin.

 

Is there any reason you don't want to use the latest release, oscommerce RC2a?

Posted

Never mind I figured it out...

 

in the .htaccess file there was an entry for a passwd file, which permissions were found in my webhost's control panel under password protected directories. Hope it helps.

  • 7 months later...
Posted
Ok, now that Burt has helped to get me un-confused :)

 

What happened is that I was hard-coding my password in the Administrators table and then putting that password in the admin/includes/configure.php file, thinking that the two passwords needed to match.

 

So by going back into to the Administrators table, changing the password to the encrypted version Burt posted - and leaving the password in the config file to the db password, I was able to log in to the admin section just fine.

 

So essentially, I was thinking that the db password and the admin password were one of the same.

 

I stand corrected!

 

Thanks to all who replied.

Posted
Ok, now that Burt has helped to get me un-confused :)

 

What happened is that I was hard-coding my password in the Administrators table and then putting that password in the admin/includes/configure.php file, thinking that the two passwords needed to match.

 

So by going back into to the Administrators table, changing the password to the encrypted version Burt posted - and leaving the password in the config file to the db password, I was able to log in to the admin section just fine.

 

So essentially, I was thinking that the db password and the admin password were one of the same.

 

I stand corrected!

 

Thanks to all who replied.

 

 

============

Hi,

 

I have a similar problem

 

I made mirror site on my local host following the instructions in (osCommerce on local host eBook by Gary Burton). I'm able to access the store on my local host but not able to log in to admin panel.

 

I have checked administrators table in DB on local host phpmyadmin, I have user name and encrypted password which was created on live site.

 

I tried using the same login details but I get Error: Invalid administrator login attempt.

 

Please guide me to solve the problem

 

Rgds,

 

GSK

  • 4 weeks later...
  • 1 year later...
Posted

I have tried everything listed in this area to log into my admin and nothing, I still get the error telling me wrong username and password, I watched multiple youtube videos on resetting the password and still nothing, I went into my phpadmin and emptied the admins and created new admin, nothing, I went in there and used the one guys code for the 'pass' password, nothing, what is there I have not tried that I can get into my admin area of oscommerce? I thought this was supposed to be an easy setup and after installing I can't even log into the admin area.

Archived

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

×
×
  • Create New...