Merge pull request #16465 from owncloud/s2s-returnpropererrorwhenpublicwebdavdisabled
Return 401 when accessing public webdav and s2s is disabled
This commit is contained in:
commit
1a67e5cdc3
|
@ -24,10 +24,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// load needed apps
|
// load needed apps
|
||||||
$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging');
|
$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
|
// wait with registering these until auth is handled and the filesystem is setup
|
||||||
$server->on('beforeMethod', function () use ($server, $objectTree, $authBackend) {
|
$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();
|
$share = $authBackend->getShare();
|
||||||
$rootShare = \OCP\Share::resolveReShare($share);
|
$rootShare = \OCP\Share::resolveReShare($share);
|
||||||
$owner = $rootShare['uid_owner'];
|
$owner = $rootShare['uid_owner'];
|
||||||
|
|
Loading…
Reference in New Issue