Skip to content
Snippets Groups Projects
Unverified Commit 47148762 authored by blizzz's avatar blizzz Committed by GitHub
Browse files

Merge pull request #26863 from nextcloud/backport/26149/stable21

[stable21] Only perform login check during ownership transfer for encryption
parents 1c1d6a03 c42b4733
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment