Add support for mysql versions >=4.0x by adding multiple hash attempts when logging in. We now

attempt sha1(), password() and if mysql >= 4.0x, old_password() hashes. Switch the default user
hash from mysql's password() function to a sha1() hash. Update user::login() to flag logins
with password() and old_password() hashes. If the flag is set we call user::update_password()
to update the users password hash to one generated from the sha1 of the users password. Add a
unit test to test logging in and upgrading from the old hashes.
This commit is contained in:
Chris Morgan
2007-07-26 14:39:15 +00:00
committed by WineHQ
parent 652fd5d517
commit 93dc3e0396
3 changed files with 146 additions and 7 deletions

View File

@@ -319,12 +319,15 @@ if(!test_user_update_password())
echo "test_user_update_password() passed\n";
}
// perform tests related to user password migration
include_once("test_user_password_migration.php");
/* Perform the maintainer tests here because they require that a user we can log into */
/* and we want to save on having to clean up the user by duplicating the cleanup code below */
include_once("test_maintainer.php");
/* TODO: the rest of the user member functions we don't currently test */
/* TODO: the rest of the user member functions we don't currently test */
/* clean up the user we created during the tests */
/* so the unit test leaves no trace that it ran */