summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobia De Koninck <LEDfan@users.noreply.github.com>2020-01-03 08:48:17 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-02-03 11:15:56 +0100
commit97508f69ec5046c3876912b80530c7a164ce49f9 (patch)
tree996d5ba6376c7df327397c20f4cc539725c255db
parent7c56144f4927ed56d02c197710833c2b10c2f65d (diff)
downloadnextcloud-server-97508f69ec5046c3876912b80530c7a164ce49f9.tar.gz
nextcloud-server-97508f69ec5046c3876912b80530c7a164ce49f9.zip
Prevent transferring data to user which never loggedin
Signed-off-by: Tobia De Koninck <LEDfan@users.noreply.github.com>
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php2
1 files changed, 1 insertions, 1 deletions
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);
}