diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-05-16 19:08:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 19:08:35 +0200 |
commit | 778db45631929d7caa07d3602ba7f462f0908c4b (patch) | |
tree | a05a53b72a0cf2d13ef9630632ed68ec53f764c5 /lib | |
parent | 795a13a8882a88537c3efe4257b855461e45a489 (diff) | |
parent | 5d69343efa4530341c339ab212ca18827332aff8 (diff) | |
download | nextcloud-server-778db45631929d7caa07d3602ba7f462f0908c4b.tar.gz nextcloud-server-778db45631929d7caa07d3602ba7f462f0908c4b.zip |
Merge pull request #32357 from nextcloud/user-delete-remove-wrappers
remove storage wrappers when deleting the user storage
Diffstat (limited to 'lib')
-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) { |