--- login/forgot_password.php	2008-12-03 18:15:52.000000000 +0100
+++ login/forgot_password.php	2010-02-24 15:35:44.000000000 +0100
@@ -106,6 +106,15 @@
 
     if ($user and !empty($user->confirmed)) {
 
+        // check if password resets are denied for this user
+        if (!empty($CFG->denyforgottenpassword) && is_array($CFG->denyforgottenpassword)) {
+            if (in_array($user->username, $CFG->denyforgottenpassword)) {
+                print_header($strforgotten, $strforgotten, $navigation);
+                notice(get_string('emailpasswordconfirmmaybesent'), $CFG->wwwroot.'/index.php');    
+                die;
+            }
+        }
+
         $userauth = get_auth_plugin($user->auth);
         if (has_capability('moodle/user:changeownpassword', $systemcontext, $user->id)) {
             // send email (make sure mail block is off)
