diff options
author | Robin Appelman <robin@icewind.nl> | 2022-05-12 15:40:20 +0300 |
---|---|---|
committer | Vincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com> | 2022-06-10 18:43:38 +0300 |
commit | 682cc2ea530c9c7ec0d1cd46da00c98ca8c05da0 (patch) | |
tree | 8f8609adbb35152615c35dca71e9ff07191460bb /lib/private | |
parent | 7bc2042628d613eeddf6c3424c81fa7daf6f9a01 (diff) |
remove storage wrappers when deleting the user storagebackport/32357/stable22
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php b/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php index fa7459e10ff..2fb05159d09 100644 --- a/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php +++ b/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace OC\Authentication\Listeners; use OC\Files\Cache\Cache; +use OC\Files\Storage\Wrapper\Wrapper; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Files\Config\IMountProviderCollection; @@ -56,6 +57,13 @@ class UserDeletedFilesCleanupListener implements IEventListener { if (!$storage) { throw new \Exception("User has no home storage"); } + + // remove all wrappers, so we do the delete directly on the home storage bypassing any wrapper + while ($storage->instanceOfStorage(Wrapper::class)) { + /** @var Wrapper $storage */ + $storage = $storage->getWrapperStorage(); + } + $this->homeStorageCache[$event->getUser()->getUID()] = $storage; } if ($event instanceof UserDeletedEvent) { |