Merge pull request #16465 from owncloud/s2s-returnpropererrorwhenpublicwebdavdisabled

Return 401 when accessing public webdav and s2s is disabled
This commit is contained in:
Morris Jobke 2015-05-20 14:28:45 +02:00
commit 1a67e5cdc3
1 changed files with 5 additions and 4 deletions

View File

@ -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'];