Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-03-07 14:24:48 +0300
committerGitHub <noreply@github.com>2022-03-07 14:24:48 +0300
commit4ee10c85ddf36faa12d324cc6d6f4b0503a1a8ca (patch)
tree931045871972039b1ca3504cad88b2dbc2fb363e
parent9ffbbd64129302318d71700bfeaac5f27a671cd6 (diff)
parent034a6e9c900881ca5643d79f1ed1e9d0bd7f0449 (diff)
Merge pull request #31446 from nextcloud/backport/30953/stable22
[stable22] Init user's file system if not existing on ownership transfer
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php13
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);
}