From 954f1112549128d4d288c8d8e820669b97e7c7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 5 Jul 2020 00:09:45 +0200 Subject: [PATCH] MAPG-141 delete password resetters when deleting account --- src/Controller/UserController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 25d14e9..9314dd7 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -1,18 +1,16 @@ request = $request; $this->pdm = new PersistentDataManager(); $this->userConfirmationRepository = new UserConfirmationRepository(); + $this->userPasswordResetterRepository = new UserPasswordResetterRepository(); } public function authorize(): bool @@ -181,6 +182,10 @@ class UserController implements ISecured $this->pdm->deleteFromDb($userConfirmation); } + foreach ($this->userPasswordResetterRepository->getByUser($user) as $userPasswordResetter) { + $this->pdm->deleteFromDb($userPasswordResetter); + } + $this->pdm->deleteFromDb($user); \Container::$dbConnection->commit();