Jump to content

Archived

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

DunWeb

Admin Password Database Error

Recommended Posts

I have searched the forums for hours to find my answer and I have found everything but what I need. So, let me ask my fiends on here:

 

I moved TWO OSC stores from Netfir*s to *odaddy. The first transferred over with no problems at all. The second transferred over with no problems either, except that the Admin Passwords for 2 the Administrators do not work.

 

The error: Error: Invalid administrator login attempt. Appears each and every time. So, I went into the database and removed the passwords, as suggested in many forums. Once completed, I was prompted for a new username and password on the Admin log in page. Perfect! However the newly entered username and password does not work. So, I checked the database again, and I can see my password (encrypted) but NO username was recorded. This led me to try to enter the username into the database manually and try to log in again. Again, the above error.

 

Question: How do I regain access to the Admin, if the database won't accept my new password ? The catalog side works, perfectly all the way through a sale but I can't gain access to admin.

 

Suggestions anyone ?

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Suggestions anyone ?

That's pretty weird since the username and password are entered in the same query. Does tep_db_prepare_input do anything strange with the username you input?

Share this post


Link to post
Share on other sites

I had this happen to me when I changed a configure file.

 

I have my admin folder set up with https and the catalog on http. BUT, in the admin configure I MUST show the catalog as https, otherwise the admin passwords will never work, no matter what I tried. I never saw the lack of a username but don't remember looking for that either...


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Hi Jan,

 

No, the username is not even entered into the database, only the encrypted password shows up in the database. The username database field is blank.

 

Mark,

 

There is not even an SSL on the site yet. The site was taken off the old host, and put onto the new host with only the paths and related info changing in the configure.php files.

 

Like I said, I transferred two ALMOST identical sites, the first with NO issues, the second with this issue. I am completely stumped by this.

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

No, the username is not even entered into the database, only the encrypted password shows up in the database. The username database field is blank.

If is inserted in the same query why would the username not be entered?

 

What happens when you truncate the table administrators and echo the variables that you would enter in login.php?

Since you cannot login either when you enter the username with phpMyAdmin I can only think of tep_db_prepare_input doing something strange with the username.

 

     case 'create':
       $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");

       if (tep_db_num_rows($check_query) == 0) {
         $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
         $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

         echo '<pre>Username: ' . $username . '<br>';
         echo '<pre>Password: ' . $password . '</pre>';
         exit;

         tep_db_query('insert into ' . TABLE_ADMINISTRATORS . ' (user_name, user_password) values ("' . $username . '", "' . tep_encrypt_password($password) . '")');
       }

Share this post


Link to post
Share on other sites

Hi Jan,

 

That did not work. However while I was looking at the Administrators table I noticed the Collation is set to latin1_swedish_ci but the username and the password fields are both utf8_general_ci this may be the problem.

 

I changed the table collation to utf8_general_ci but still can't log in.

 

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

That did not work.

It's not supposed to fix the problem, it might help pinpoint the problem. If the username you entered shows up the same as you typed it at least that part is not the problem.

Share this post


Link to post
Share on other sites

Another it won't fix it but might help find the issue suggestion would be to use phpMyAdmin to enter the username/password and see if you can log in.

Well Chris said he already tried that but still couldn't log in. If he used just lower ASCII characters for the user name and no spaces I can't see what could be the issue here.

Share this post


Link to post
Share on other sites

Hi Mark,

 

No, I tried entering the UN and PW directly into the DB. Received the same error. I checked the OLD host because everything is still there. I can log into netfir*s using the direct URL to the Admin, and it works there. So, now this confuses me even more.

 

Nothing has changed except the host. Still the same SQL version and Same PHP version and this site is the SECOND of the two identical sites (first having no problems with the transfer)

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Hi Jan,

 

That did not work. However while I was looking at the Administrators table I noticed the Collation is set to latin1_swedish_ci but the username and the password fields are both utf8_general_ci this may be the problem.

 

I changed the table collation to utf8_general_ci but still can't log in.

 

 

 

Chris

My username field is latin1_bin and password is latin1_swedish_ci

 

Try that.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Hi Mark,

 

Ya, I changed it from that to utf8 to see if it would work then, but didn't. I am still playing with it, something has to work .

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

I had exactly the same symptoms.

 

Password stopped working.

 

Cleared administrators table and an administrator record with no name was created.

 

Run sql to put admin/admin in the db and log in fails

 

 

Wonder why this is so?

 

I had this happen to me when I changed a configure file.

 

I have my admin folder set up with https and the catalog on http. BUT, in the admin configure I MUST show the catalog as https, otherwise the admin passwords will never work, no matter what I tried. I never saw the lack of a username but don't remember looking for that either...

 

Changed admin configure from:-

 

  define('HTTP_SERVER', 'http://www.xxx.com');
 define('HTTP_CATALOG_SERVER', 'http://www.xxx.com');
 define('HTTPS_CATALOG_SERVER', 'http://www.xxx.com');

 

to

 

  define('HTTP_SERVER', 'http://www.xxx.com');
 define('HTTP_CATALOG_SERVER', 'https://www.xxx.com');
 define('HTTPS_CATALOG_SERVER', 'https://www.xxx.com');

 

And hey presto I can log in again.

 

Just had to delete my admin/admin record and all everything is hunky dory.

 

Thanks Mark

 

G


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 ======>>>>>.

Share this post


Link to post
Share on other sites

Hi,

 

I have the exact same problem. However, when I tried to enter the changes in the admin/configuration.php, those 3 "define" lines are not even in there. I did a search for that string and it's definitely not in that file.

Share this post


Link to post
Share on other sites

Hi,

 

I have the exact same problem. However, when I tried to enter the changes in the admin/configuration.php, those 3 "define" lines are not even in there. I did a search for that string and it's definitely not in that file.

 

This is your "admin" configure.php file (not "admin" configuration.php):

 

<?php
/*
 $Id$

 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', ''); // eg, http://localhost or - https://localhost should not be NULL for productive servers
 define('HTTP_CATALOG_SERVER', '');
 define('HTTPS_CATALOG_SERVER', '');
 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', '/admin/');
 define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
 define('DIR_WS_CATALOG', '/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('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

// define our database connection
 define('DB_SERVER', '');
 define('DB_SERVER_USERNAME', 'mysql');
 define('DB_SERVER_PASSWORD', '');
 define('DB_DATABASE', 'osCommerce');
 define('USE_PCONNECT', 'false');
 define('STORE_SESSIONS', '');
?>

 

If you don't have the same then your problem might be explained?


My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Share this post


Link to post
Share on other sites

So I opened the admin/includes/configure.php file, made the changes, uploaded on the server, emptied the administrators table and attempted to create an administrator.

 

Result: 404 error message, file not found!

Share this post


Link to post
Share on other sites

So I opened the admin/includes/configure.php file, made the changes, uploaded on the server, emptied the administrators table and attempted to create an administrator.

 

Result: 404 error message, file not found!

Which file was not found?

Share this post


Link to post
Share on other sites

Guys,

 

Wouldn't it be easier to just scrap this cart, delete everything on the server and start a new cart from scratch?

 

Just a thought.

 

Ed

Share this post


Link to post
Share on other sites

Probably would be but if you have a site you are loath to just bin it.

 

Changing /admin/includes/configure.php as mentioned above worked for me.

 

Suspect it was /admin/login.php?action=process

 

Cheers

 

G


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 ======>>>>>.

Share this post


Link to post
Share on other sites

I don't know what you are trying to say here:

 

Suspect it was /admin/login.php?action=process

Share this post


Link to post
Share on other sites

I suspect the page you were trying to load that gave a 404 error was......


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 ======>>>>>.

Share this post


Link to post
Share on other sites

If this is the page that loads when I try to create an administrator, then you may be right.

Share this post


Link to post
Share on other sites

Try changing /admin/includes/configure.php back to the original values and see if it works again.

 

I, being of very little brain, can't see how that change would give a 404 error, but there again I can't see how changing it to https would make it work.

 

Cheers

 

G


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 ======>>>>>.

Share this post


Link to post
Share on other sites

×