diff options
author | yemkareems <yemkareems@gmail.com> | 2024-05-16 16:48:47 +0530 |
---|---|---|
committer | Louis <louis@chmn.me> | 2024-05-16 17:00:21 +0200 |
commit | 0c0b81602972a17bf81dfb2827e9d03bc2848b1b (patch) | |
tree | af100dfde8c05872a6537dbf89e94e7f378d9dd0 | |
parent | f6a8605f580a80e9c0de89a4d82e3b2d03ac6d76 (diff) | |
download | nextcloud-server-0c0b81602972a17bf81dfb2827e9d03bc2848b1b.tar.gz nextcloud-server-0c0b81602972a17bf81dfb2827e9d03bc2848b1b.zip |
fix: delete user credentials stored in storages_credentials when user gets deleted
Signed-off-by: yemkareems <yemkareems@gmail.com>
[skip ci]
-rw-r--r-- | lib/private/User/Listeners/BeforeUserDeletedListener.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/User/Listeners/BeforeUserDeletedListener.php b/lib/private/User/Listeners/BeforeUserDeletedListener.php index ec1f80c5413..42d07a51682 100644 --- a/lib/private/User/Listeners/BeforeUserDeletedListener.php +++ b/lib/private/User/Listeners/BeforeUserDeletedListener.php @@ -35,10 +35,12 @@ use Psr\Log\LoggerInterface; */ class BeforeUserDeletedListener implements IEventListener { private IAvatarManager $avatarManager; + private ICredentialsManager $credentialsManager; private LoggerInterface $logger; - public function __construct(LoggerInterface $logger, IAvatarManager $avatarManager) { + public function __construct(LoggerInterface $logger, IAvatarManager $avatarManager, ICredentialsManager $credentialsManager) { $this->avatarManager = $avatarManager; + $this->credentialsManager = $credentialsManager; $this->logger = $logger; } @@ -61,5 +63,7 @@ class BeforeUserDeletedListener implements IEventListener { 'exception' => $e, ]); } + // Delete storages credentials on user deletion + $this->credentialsManager->erase($user->getUID()); } } |