Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/Controller/ShareController.php')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 1542cbe4924..95e0097b91b 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -271,6 +271,18 @@ class ShareController extends AuthPublicShareController {
* @return bool
*/
private function validateShare(\OCP\Share\IShare $share) {
+ // If the owner is disabled no access to the linke is granted
+ $owner = $this->userManager->get($share->getShareOwner());
+ if ($owner === null || !$owner->isEnabled()) {
+ return false;
+ }
+
+ // If the initiator of the share is disabled no access is granted
+ $initiator = $this->userManager->get($share->getSharedBy());
+ if ($initiator === null || !$initiator->isEnabled()) {
+ return false;
+ }
+
return $share->getNode()->isReadable() && $share->getNode()->isShareable();
}