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:
parent
e51dd5d7d1
commit
a99e7c0cee
|
@ -433,11 +433,15 @@ function wp_authenticate($username, $password) {
|
||||||
|
|
||||||
$user = get_userdatabylogin($username);
|
$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.'));
|
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.'));
|
return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.'));
|
||||||
|
}
|
||||||
|
|
||||||
// If using old md5 password, rehash.
|
// If using old md5 password, rehash.
|
||||||
if ( strlen($user->user_pass) <= 32 )
|
if ( strlen($user->user_pass) <= 32 )
|
||||||
|
|
Loading…
Reference in New Issue