summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-17 16:51:19 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-17 16:51:19 +0100
commit7d638fdb3418be7990c230290494a8fd6d1a25d5 (patch)
tree930b274b1370af7a616a4580d3770d1f49adc516 /apps
parent8fb3e446107da26ac654ffc25af6814a17cb9022 (diff)
downloadnextcloud-server-7d638fdb3418be7990c230290494a8fd6d1a25d5.tar.gz
nextcloud-server-7d638fdb3418be7990c230290494a8fd6d1a25d5.zip
In debugging mode we enable Sabre's browser plugin since it helps a lot when debugging
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/appinfo/v1/caldav.php13
-rw-r--r--apps/dav/appinfo/v1/carddav.php13
-rw-r--r--apps/dav/lib/server.php9
3 files changed, 26 insertions, 9 deletions
diff --git a/apps/dav/appinfo/v1/caldav.php b/apps/dav/appinfo/v1/caldav.php
index f2c886e0fdd..e9b6e3759ab 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 44abcbaa190..bd5ed465dce 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 05e81a1184c..f624137f316 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());