diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-01-02 21:24:37 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-01-10 17:04:32 +0100 |
commit | fcda3a20f455795b898161ec4ada0aeb500b9218 (patch) | |
tree | d1819e6c04954377ede49bbf80ebc02335acf2a2 /core/Controller/LostController.php | |
parent | 40239decb1b36f1daff53710e01d81e18c24f4fc (diff) | |
download | nextcloud-server-fcda3a20f455795b898161ec4ada0aeb500b9218.tar.gz nextcloud-server-fcda3a20f455795b898161ec4ada0aeb500b9218.zip |
create new encryption keys on password reset and backup the old one
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/Controller/LostController.php')
-rw-r--r-- | core/Controller/LostController.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index b12abf38142..a0ef87e50d8 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -234,6 +234,8 @@ class LostController extends Controller { $this->checkPasswordResetToken($token, $userId); $user = $this->userManager->get($userId); + \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', array('uid' => $userId, 'password' => $password)); + if (!$user->setPassword($password)) { throw new \Exception(); } @@ -242,11 +244,6 @@ class LostController extends Controller { $this->config->deleteUserValue($userId, 'core', 'lostpassword'); @\OC_User::unsetMagicInCookie(); - } catch (PrivateKeyMissingException $e) { - // in this case it is OK if we couldn't reset the users private key - // They chose explicitely to continue at the password reset dialog - // (see $proceed flag) - return $this->success(); } catch (\Exception $e){ return $this->error($e->getMessage()); } |