Allow disabling password reset per user. Props axelseaa. fixes #7344 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@8400 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-07-22 19:15:42 +00:00
parent 13ff742a0c
commit 5c959b11ba
1 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,13 @@ function retrieve_password() {
do_action('retreive_password', $user_login); // Misspelled and deprecated
do_action('retrieve_password', $user_login);
$allow = apply_filters('allow_password_reset', true, $user_data->id);
if ( ! $allow )
return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
else if ( is_wp_error($allow) )
return $allow;
$key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
if ( empty($key) ) {
// Generate something random for a key...