diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-02-10 18:13:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 18:13:43 +0100 |
commit | 62d47100ec36a6c7de286f473f91400233edbf4c (patch) | |
tree | 77558db3aeb245044c0c561b3c5d7c9fb1ff50eb /apps | |
parent | 713840ccc0192d303374d7fc94c1ed1861cb5452 (diff) | |
parent | 02da4ce1b03d929569d98986b25da99e0c573ddd (diff) | |
download | nextcloud-server-62d47100ec36a6c7de286f473f91400233edbf4c.tar.gz nextcloud-server-62d47100ec36a6c7de286f473f91400233edbf4c.zip |
Merge pull request #30953 from nextcloud/feat/init-storage-when-transferring-ownership
Init user's file system if not existing on ownership transfer
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Service/OwnershipTransferService.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 670e6419d75..661a7e66e10 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -144,13 +144,12 @@ class OwnershipTransferService { throw new TransferOwnershipException("Unknown path provided: $path", 1); } - if ($move && ( - !$view->is_dir($finalTarget) || ( - !$firstLogin && - count($view->getDirectoryContent($finalTarget)) > 0 - ) - ) - ) { + if ($move && !$view->is_dir($finalTarget)) { + // Initialize storage + \OC_Util::setupFS($destinationUser->getUID()); + } + + if ($move && !$firstLogin && count($view->getDirectoryContent($finalTarget)) > 0) { throw new TransferOwnershipException("Destination path does not exists or is not empty", 1); } |