diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index fe4b132392fdd..0cc7f1a21248e 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -262,18 +262,6 @@ protected function emitShareAccessEvent(IShare $share, string $step = '', int $e * @return bool */ private function validateShare(IShare $share) { - // If the owner is disabled no access to the link 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(); } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 7fab145801ae2..524f121bb9297 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1402,7 +1402,7 @@ private function checkShare(IShare $share, int &$added = 1): void { $added--; throw new ShareNotFound($this->l->t('The requested share does not exist anymore')); } - if ($this->config->getAppValue('files_sharing', 'hide_disabled_user_shares', 'no') === 'yes') { + if ($this->config->getAppValue('files_sharing', 'hide_disabled_user_shares', 'yes') === 'yes') { $uids = array_unique([$share->getShareOwner(), $share->getSharedBy()]); foreach ($uids as $uid) { $user = $this->userManager->get($uid); diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 72a71cdfe2f1c..3f04fe50df731 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -3882,7 +3882,7 @@ public function testGetShareByTokenHideDisabledUser(): void { ->method('getAppValue') ->willReturnMap([ ['core', 'shareapi_allow_links', 'yes', 'yes'], - ['files_sharing', 'hide_disabled_user_shares', 'no', 'yes'], + ['files_sharing', 'hide_disabled_user_shares', 'yes', 'yes'], ]); $this->l->expects($this->once())