Browse Source

Merge pull request #30953 from nextcloud/feat/init-storage-when-transferring-ownership

Init user's file system if not existing on ownership transfer
tags/v24.0.0beta1
Vincent Petry 2 years ago
parent
commit
62d47100ec
No account linked to committer's email address
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      apps/files/lib/Service/OwnershipTransferService.php

+ 6
- 7
apps/files/lib/Service/OwnershipTransferService.php View File

@@ -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);
}


Loading…
Cancel
Save