Add wp_login_failed action

git-svn-id: http://svn.automattic.com/wordpress/trunk@6647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-24 18:32:21 +00:00
parent e51dd5d7d1
commit a99e7c0cee

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 )