summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-22 20:28:25 +0100
committerGitHub <noreply@github.com>2021-03-22 20:28:25 +0100
commit90909ab9b9f2263e854788802794007a6d766356 (patch)
tree0bdb83bbdd046e53eb818925db069281c61a6580 /apps/files
parent51823ade26bc34456d6ae6d9f03da8d119cfd686 (diff)
parente68c4a4ed377822d700b9a146704e8434c1b9516 (diff)
downloadnextcloud-server-90909ab9b9f2263e854788802794007a6d766356.tar.gz
nextcloud-server-90909ab9b9f2263e854788802794007a6d766356.zip
Merge pull request #26149 from nextcloud/fix/ownership-transfer-ready-encryption
Only perform login check during ownership transfer for encryption
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index 870aa9f9d77..3ab1a0c29d5 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -100,12 +100,15 @@ class OwnershipTransferService {
$destinationUid = $destinationUser->getUID();
$sourcePath = rtrim($sourceUid . '/files/' . $path, '/');
- // target user has to be ready
- if ($destinationUser->getLastLogin() === 0 || !$this->encryptionManager->isReadyForUser($destinationUid)) {
+ // If encryption is on we have to ensure the user has logged in before and that all encryption modules are ready
+ if (($this->encryptionManager->isEnabled() && $destinationUser->getLastLogin() === 0)
+ || !$this->encryptionManager->isReadyForUser($destinationUid)) {
throw new TransferOwnershipException("The target user is not ready to accept files. The user has at least to have logged in once.", 2);
}
// setup filesystem
+ // Requesting the user folder will set it up if the user hasn't logged in before
+ \OC::$server->getUserFolder($destinationUser->getUID());
Filesystem::initMountPoints($sourceUid);
Filesystem::initMountPoints($destinationUid);