Add wp_authenticate_user filter
git-svn-id: http://svn.automattic.com/wordpress/trunk@6685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5246f532f
commit
19de78b638
|
@ -438,6 +438,12 @@ function wp_authenticate($username, $password) {
|
||||||
return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
|
return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user = apply_filters('wp_authenticate_user', $user, $password);
|
||||||
|
if ( is_wp_error($user) ) {
|
||||||
|
do_action( 'wp_login_failed', $username );
|
||||||
|
return $user;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !wp_check_password($password, $user->user_pass) ) {
|
if ( !wp_check_password($password, $user->user_pass) ) {
|
||||||
do_action( 'wp_login_failed', $username );
|
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.'));
|
||||||
|
|
Loading…
Reference in New Issue