Latest News: (loading..)
Issue Information
-
#000016
-
1 - Low
-
Fixed
-
2.2
-
2.3
Issue Confirmations
-
Yes (0)No (1)
Login errors if you change admin password or delete admin accounts
Posted by RoohBear on 13 July 2010 - 11:33 PM
This seems like a real bug with version 2.2 RC2, and here's how to reproduce it:
log into myPhpAdmin and delete all the administrator accounts in the database (delete all the records in the "Administrators" table)
Go to your website's catalog/admin page and try to log in. You'll get a message that there are no admin accounts, you'll get the opportunity to make one, then log in with it.
Enter in the username and password of a new admin account, log in, then log out. Try to log back in and I bet you can't. I get errors galore that the user name and/or password are invalid so I started adding some debug statements to login.php.
Around line 44 of login.php, I added some statements that display some variable values to $messageStack. Here's a code snippet:
tep_session_unregister('redirect_origin');
tep_redirect(tep_href_link($page, $get_string));
} else {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
}else{
$messageStack->add('gregtest1', 'error');
}
}else{
$messageStack->add('gregtest2', 'error');
$messageStack->add('username=' . $username . '<br />', 'error');
$messageStack->add('password=' . $password . '<br />', 'error');
$messageStack->add('check=' . $check . '<br />', 'error');
$messageStack->add('check_query=' . $check_query . '<br />', 'error');
$messageStack->add('query=' . $query . '<br />', 'error');
$messageStack->add('tep_db_num_rows(check_query)=' . tep_db_num_rows($check_query) . '<br />', 'error');
}
The code that outputs 'gregtest2' is getting called. One thing that's completely strange is that $check_query has the value of "Resource id #29" all the time! Where is that coming from? tep_db_num_rows($check_query) is 0 which is not good... it's supposed to be 1.
Another weird thing is that if I press the Login button again, $username and $password are blank no matter what I put in there.
log into myPhpAdmin and delete all the administrator accounts in the database (delete all the records in the "Administrators" table)
Go to your website's catalog/admin page and try to log in. You'll get a message that there are no admin accounts, you'll get the opportunity to make one, then log in with it.
Enter in the username and password of a new admin account, log in, then log out. Try to log back in and I bet you can't. I get errors galore that the user name and/or password are invalid so I started adding some debug statements to login.php.
Around line 44 of login.php, I added some statements that display some variable values to $messageStack. Here's a code snippet:
tep_session_unregister('redirect_origin');
tep_redirect(tep_href_link($page, $get_string));
} else {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
}else{
$messageStack->add('gregtest1', 'error');
}
}else{
$messageStack->add('gregtest2', 'error');
$messageStack->add('username=' . $username . '<br />', 'error');
$messageStack->add('password=' . $password . '<br />', 'error');
$messageStack->add('check=' . $check . '<br />', 'error');
$messageStack->add('check_query=' . $check_query . '<br />', 'error');
$messageStack->add('query=' . $query . '<br />', 'error');
$messageStack->add('tep_db_num_rows(check_query)=' . tep_db_num_rows($check_query) . '<br />', 'error');
}
The code that outputs 'gregtest2' is getting called. One thing that's completely strange is that $check_query has the value of "Resource id #29" all the time! Where is that coming from? tep_db_num_rows($check_query) is 0 which is not good... it's supposed to be 1.
Another weird thing is that if I press the Login button again, $username and $password are blank no matter what I put in there.
Updating status to: Won't Fix
Issue fixed in: 3.0
Hi Greg..
I can't reproduce the issue but have made an update that parses the username and password in the query that inserts the new administrator in the database. Could you see if this change helps you:
http://github.com/haraldpdl/oscommerce2/commit/1a6543773bb482dff4b4ae9e2c4bdf0d8853ccf5
Thanks,
Issue fixed in: 3.0
Hi Greg..
I can't reproduce the issue but have made an update that parses the username and password in the query that inserts the new administrator in the database. Could you see if this change helps you:
http://github.com/haraldpdl/oscommerce2/commit/1a6543773bb482dff4b4ae9e2c4bdf0d8853ccf5
Thanks,
Issue fixed in: None
Ooooh.. MUCH better! Thanks!
Updating status to: Fixed
Updating severity to: 1 - Low
Issue fixed in: 2.3
Updating severity to: 1 - Low
Issue fixed in: 2.3
Issue fixed in: 2.3










