]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent transferring data to user which never loggedin
authorTobia De Koninck <LEDfan@users.noreply.github.com>
Fri, 3 Jan 2020 07:48:17 +0000 (08:48 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 3 Feb 2020 10:15:56 +0000 (11:15 +0100)
Signed-off-by: Tobia De Koninck <LEDfan@users.noreply.github.com>
apps/files/lib/Service/OwnershipTransferService.php

index 8af894a01673a79537239e8acf6ab5e959876dfa..3dc55615c9525c9a4f42da2d8b0807f1d1302ae7 100644 (file)
@@ -87,7 +87,7 @@ class OwnershipTransferService {
                $sourcePath = rtrim($sourceUid . '/files/' . $path, '/');
 
                // target user has to be ready
-               if (!$this->encryptionManager->isReadyForUser($destinationUid)) {
+               if ($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);
                }