From 6cc23b170a326d7fee7afc521cef9282ce776fe4 Mon Sep 17 00:00:00 2001 From: Tobia De Koninck Date: Fri, 3 Jan 2020 08:48:17 +0100 Subject: Prevent transferring data to user which never loggedin Signed-off-by: Tobia De Koninck --- apps/files/lib/Service/OwnershipTransferService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 8af894a0167..3dc55615c95 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -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); } -- cgit v1.2.3