Add wp_login_failed action

git-svn-id: https://develop.svn.wordpress.org/trunk@6647 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-01-24 18:32:21 +00:00
parent 4aa89972c8
commit b58ed9e123
1 changed files with 6 additions and 2 deletions

View File

@ -433,11 +433,15 @@ function wp_authenticate($username, $password) {
$user = get_userdatabylogin($username);
if ( !$user || ($user->user_login != $username) )
if ( !$user || ($user->user_login != $username) ) {
do_action( 'wp_login_failed', $username );
return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
}
if ( !wp_check_password($password, $user->user_pass) )
if ( !wp_check_password($password, $user->user_pass) ) {
do_action( 'wp_login_failed', $username );
return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.'));
}
// If using old md5 password, rehash.
if ( strlen($user->user_pass) <= 32 )