diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-09-09 22:33:03 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-02-07 07:47:38 +0100 |
commit | 260892eb3bef81af4ac01d36ba3dde5952abaa5d (patch) | |
tree | f7bdf417eb08647198c09bf6f59fdf3ca53778f0 /apps/files_sharing/lib | |
parent | d2d7e37b7bf00ea7929da02459e4abb8640d064a (diff) | |
download | nextcloud-server-260892eb3bef81af4ac01d36ba3dde5952abaa5d.tar.gz nextcloud-server-260892eb3bef81af4ac01d36ba3dde5952abaa5d.zip |
Disable link shares of disabled users
Fixes #10869
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 12 |
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(); } |