Browse Source

Merge pull request #787 from NicoDucou/1.10.x.9798

Delete token and time from user password reset after first use -refs …
Yannick Warnier 9 years ago
parent
commit
55349cf472
1 changed files with 6 additions and 0 deletions
  1. 6 0
      main/auth/reset.php

+ 6 - 0
main/auth/reset.php

@@ -48,6 +48,12 @@ if ($form->validate()) {
         $userManager = UserManager::getManager();
         $userManager->updateUser($user, true);
 
+        $user->setConfirmationToken(null);
+        $user->setPasswordRequestedAt(null);
+
+        Database::getManager()->persist($user);
+        Database::getManager()->flush();
+
         Display::addFlash(Display::return_message(get_lang('Updated')));
         header('Location: '.api_get_path(WEB_PATH));
         exit;