From a0b5e9133d380cc6b40ed45a010f596e1ff53728 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 22 Jul 2008 19:15:42 +0000 Subject: [PATCH] Allow disabling password reset per user. Props axelseaa. fixes #7344 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8400 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-login.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-login.php b/wp-login.php index 8b58c24c2b..559287f774 100644 --- a/wp-login.php +++ b/wp-login.php @@ -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...