Skip to content

Commit 6dbb26f

Browse files
committed
Disable link shares of disabled users
Fixes #10869 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent bf6082e commit 6dbb26f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

apps/files_sharing/lib/Controller/ShareController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ protected function emitAccessShareHook($share, $errorCode = 200, $errorMessage =
266266
* @return bool
267267
*/
268268
private function validateShare(\OCP\Share\IShare $share) {
269+
// If the owner is disabled no access to the linke is granted
270+
$owner = $this->userManager->get($share->getShareOwner());
271+
if ($owner === null || !$owner->isEnabled()) {
272+
return false;
273+
}
274+
275+
// If the initiator of the share is disabled no access is granted
276+
$initiator = $this->userManager->get($share->getSharedBy());
277+
if ($initiator === null || !$initiator->isEnabled()) {
278+
return false;
279+
}
280+
269281
return $share->getNode()->isReadable() && $share->getNode()->isShareable();
270282
}
271283

0 commit comments

Comments
 (0)