From a99e7c0ceea66896608d3ee2403b565917ab1bfb Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 24 Jan 2008 18:32:21 +0000 Subject: [PATCH] Add wp_login_failed action git-svn-id: http://svn.automattic.com/wordpress/trunk@6647 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 )