Improved login from Viper007Bond. fixes #3123

git-svn-id: https://develop.svn.wordpress.org/trunk@4339 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-10-04 16:47:50 +00:00
parent 6fe1352183
commit 29b992e902
5 changed files with 295 additions and 321 deletions

View File

@@ -178,7 +178,7 @@ function wp_login($username, $password, $already_md5 = false) {
return false;
if ( '' == $password ) {
$error = __('<strong>Error</strong>: The password field is empty.');
$error = __('<strong>ERROR</strong>: The password field is empty.');
return false;
}
@@ -186,7 +186,7 @@ function wp_login($username, $password, $already_md5 = false) {
//$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
if (!$login) {
$error = __('<strong>Error</strong>: Wrong username.');
$error = __('<strong>ERROR</strong>: Invalid username.');
return false;
} else {
// If the password is already_md5, it has been double hashed.
@@ -194,7 +194,7 @@ function wp_login($username, $password, $already_md5 = false) {
if ( ($already_md5 && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) {
return true;
} else {
$error = __('<strong>Error</strong>: Incorrect password.');
$error = __('<strong>ERROR</strong>: Incorrect password.');
$pwd = '';
return false;
}