diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-05-20 12:19:03 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-05-20 12:19:03 +0200 |
commit | f2a900e04ce80e259930341167a3c4575ea76275 (patch) | |
tree | 3d125b58d9942008318e42bc7b5cdf2e3daca639 /apps | |
parent | 12aef311154f12050c4e33492dac1fb1c928060d (diff) | |
download | nextcloud-server-f2a900e04ce80e259930341167a3c4575ea76275.tar.gz nextcloud-server-f2a900e04ce80e259930341167a3c4575ea76275.zip |
Return 401 when accessing public webdav and s2s is disabled
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/publicwebdav.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php index c2a16e933b3..b70274e6bc0 100644 --- a/apps/files_sharing/publicwebdav.php +++ b/apps/files_sharing/publicwebdav.php @@ -24,10 +24,6 @@ * */ -if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) { - return false; -} - // load needed apps $RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging'); @@ -56,6 +52,11 @@ $server->addPlugin(new \OC\Connector\Sabre\ExceptionLoggerPlugin('webdav', \OC:: // wait with registering these until auth is handled and the filesystem is setup $server->on('beforeMethod', function () use ($server, $objectTree, $authBackend) { + if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) { + // this is what is thrown when trying to access a non-existing share + throw new \Sabre\DAV\Exception\NotAuthenticated(); + } + $share = $authBackend->getShare(); $rootShare = \OCP\Share::resolveReShare($share); $owner = $rootShare['uid_owner']; |