From b58ed9e12329d33ddceeb6fe5544012b9d62d330 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 24 Jan 2008 18:32:21 +0000 Subject: [PATCH] Add wp_login_failed action git-svn-id: https://develop.svn.wordpress.org/trunk@6647 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 0c6a34e55e..4b4e0e0dc8 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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', __('ERROR: 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', __('ERROR: Incorrect password.')); + } // If using old md5 password, rehash. if ( strlen($user->user_pass) <= 32 )