Merge pull request #26862 from nextcloud/backport/26149/stable20
[stable20] Only perform login check during ownership transfer for encryption
This commit is contained in:
commit
eca4717ca1
|
@ -101,12 +101,15 @@ class OwnershipTransferService {
|
||||||
$destinationUid = $destinationUser->getUID();
|
$destinationUid = $destinationUser->getUID();
|
||||||
$sourcePath = rtrim($sourceUid . '/files/' . $path, '/');
|
$sourcePath = rtrim($sourceUid . '/files/' . $path, '/');
|
||||||
|
|
||||||
// target user has to be ready
|
// If encryption is on we have to ensure the user has logged in before and that all encryption modules are ready
|
||||||
if ($destinationUser->getLastLogin() === 0 || !$this->encryptionManager->isReadyForUser($destinationUid)) {
|
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);
|
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
|
// 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($sourceUid);
|
||||||
Filesystem::initMountPoints($destinationUid);
|
Filesystem::initMountPoints($destinationUid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue