=== modified file 'modules/user/user.pages.inc'
--- modules/user/user.pages.inc	2010-12-01 00:29:41 +0000
+++ modules/user/user.pages.inc	2011-02-18 03:43:21 +0000
@@ -136,6 +136,10 @@ function user_pass_reset($form, &$form_s
           // Let the user's password be changed without the current password check.
           $token = drupal_hash_base64(drupal_random_bytes(55));
           $_SESSION['pass_reset_' . $user->uid] = $token;
+          // Clear the flood events against this user.
+          flood_clear_event('failed_login_attempt_user', $account->uid);
+          flood_clear_event('failed_login_attempt_user', $account->uid . '-' . ip_address());
+          flood_clear_event('failed_login_attempt_ip');
           drupal_goto('user/' . $user->uid . '/edit', array('query' => array('pass-reset-token' => $token)));
         }
         else {

=== modified file 'modules/user/user.test'
--- modules/user/user.test	2010-12-18 00:56:18 +0000
+++ modules/user/user.test	2011-02-18 03:56:42 +0000
@@ -325,6 +325,18 @@ class UserLoginTestCase extends DrupalWe
     // A login with the correct password should also result in a flood error
     // message.
     $this->assertFailedLogin($user1, 'ip');
+
+    // After a password reset, however, login should succeed.
+    // user_pass_reset_url can't be used as the last login of this user is
+    // later than REQUEST_TIME. However, that login needs to be loaded.
+    $user1->login = user_load($user1->uid)->login;
+    $hash = user_pass_rehash($user1->pass, $user1->login, $user1->login);
+    $this->drupalGet("user/reset/$user1->uid/$user1->login/$hash/login");
+    // Check that the user password reset URL worked.
+    $this->assertLink(t('Log out'), 0, t('User %name successfully logged in.', array('%name' => $user1->name)), t('User login'));
+    // Log out and back in and assert there are no problems with the log in.
+    $this->drupalLogout();
+    $this->drupalLogin($user1);
   }
 
   /**

