diff --git a/apps/dav/appinfo/v1/caldav.php b/apps/dav/appinfo/v1/caldav.php index f2c886e0fd..e9b6e3759a 100644 --- a/apps/dav/appinfo/v1/caldav.php +++ b/apps/dav/appinfo/v1/caldav.php @@ -23,6 +23,7 @@ // Backends use OCA\DAV\CalDAV\CalDavBackend; +use OCA\DAV\Connector\LegacyDAVACL; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; use OCA\DAV\Connector\Sabre\MaintenancePlugin; @@ -43,12 +44,14 @@ $principalBackend = new Principal( $db = \OC::$server->getDatabaseConnection(); $calDavBackend = new CalDavBackend($db, $principalBackend); +$debugging = \OC::$server->getConfig()->getSystemValue('debug', false); + // Root nodes $principalCollection = new \Sabre\CalDAV\Principal\Collection($principalBackend); -$principalCollection->disableListing = true; // Disable listing +$principalCollection->disableListing = !$debugging; // Disable listing $addressBookRoot = new CalendarRoot($principalBackend, $calDavBackend); -$addressBookRoot->disableListing = true; // Disable listing +$addressBookRoot->disableListing = !$debugging; // Disable listing $nodes = array( $principalCollection, @@ -65,8 +68,10 @@ $server->addPlugin(new MaintenancePlugin()); $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud')); $server->addPlugin(new \Sabre\CalDAV\Plugin()); -$acl = new \OCA\DAV\Connector\LegacyDAVACL(); -$server->addPlugin($acl); +$server->addPlugin(new LegacyDAVACL()); +if ($debugging) { + $server->addPlugin(new Sabre\DAV\Browser\Plugin()); +} $server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin()); $server->addPlugin(new ExceptionLoggerPlugin('caldav', \OC::$server->getLogger())); diff --git a/apps/dav/appinfo/v1/carddav.php b/apps/dav/appinfo/v1/carddav.php index 44abcbaa19..bd5ed465dc 100644 --- a/apps/dav/appinfo/v1/carddav.php +++ b/apps/dav/appinfo/v1/carddav.php @@ -24,6 +24,7 @@ // Backends use OCA\DAV\CardDAV\AddressBookRoot; use OCA\DAV\CardDAV\CardDavBackend; +use OCA\DAV\Connector\LegacyDAVACL; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; use OCA\DAV\Connector\Sabre\MaintenancePlugin; @@ -44,12 +45,14 @@ $principalBackend = new Principal( $db = \OC::$server->getDatabaseConnection(); $cardDavBackend = new CardDavBackend($db, $principalBackend); +$debugging = \OC::$server->getConfig()->getSystemValue('debug', false); + // Root nodes $principalCollection = new \Sabre\CalDAV\Principal\Collection($principalBackend); -$principalCollection->disableListing = true; // Disable listing +$principalCollection->disableListing = !$debugging; // Disable listing $addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend); -$addressBookRoot->disableListing = true; // Disable listing +$addressBookRoot->disableListing = !$debugging; // Disable listing $nodes = array( $principalCollection, @@ -65,8 +68,10 @@ $server->addPlugin(new MaintenancePlugin()); $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud')); $server->addPlugin(new Plugin()); -$acl = new \OCA\DAV\Connector\LegacyDAVACL(); -$server->addPlugin($acl); +$server->addPlugin(new LegacyDAVACL()); +if ($debugging) { + $server->addPlugin(new Sabre\DAV\Browser\Plugin()); +} $server->addPlugin(new \Sabre\CardDAV\VCFExportPlugin()); $server->addPlugin(new ExceptionLoggerPlugin('carddav', \OC::$server->getLogger())); diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php index 05e81a1184..f624137f31 100644 --- a/apps/dav/lib/server.php +++ b/apps/dav/lib/server.php @@ -28,6 +28,7 @@ use OCA\DAV\Connector\FedAuth; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; use OCA\DAV\Connector\Sabre\DavAclPlugin; +use OCA\DAV\Connector\Sabre\DummyGetResponsePlugin; use OCA\DAV\Connector\Sabre\FilesPlugin; use OCA\DAV\Files\CustomPropertiesBackend; use OCP\IRequest; @@ -68,7 +69,13 @@ class Server { $event = new SabrePluginEvent($this->server); $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event); - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\DummyGetResponsePlugin()); + // debugging + if(\OC::$server->getConfig()->getSystemValue('debug', false)) { + $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin()); + } else { + $this->server->addPlugin(new DummyGetResponsePlugin()); + } + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin());