diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-05-20 14:28:45 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-05-20 14:28:45 +0200 |
commit | 1a67e5cdc3242433225b6b8c08b7664f47c78255 (patch) | |
tree | b3c1ca6a24a741329bf895a5660d0cf6ea4c981e /apps | |
parent | 7386257676cff4648f4e71d05cdabff75578e947 (diff) | |
parent | f2a900e04ce80e259930341167a3c4575ea76275 (diff) | |
download | nextcloud-server-1a67e5cdc3242433225b6b8c08b7664f47c78255.tar.gz nextcloud-server-1a67e5cdc3242433225b6b8c08b7664f47c78255.zip |
Merge pull request #16465 from owncloud/s2s-returnpropererrorwhenpublicwebdavdisabled
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']; |