diff options
Diffstat (limited to 'apps/dav/lib/Server.php')
-rw-r--r-- | apps/dav/lib/Server.php | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 77002682fa6..79c4301a8d8 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -33,11 +33,14 @@ use OCA\DAV\CardDAV\ImageExportPlugin; use OCA\DAV\Comments\CommentsPlugin; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; +use OCA\DAV\Connector\Sabre\CommentPropertiesPlugin; use OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin; use OCA\DAV\Connector\Sabre\DavAclPlugin; use OCA\DAV\Connector\Sabre\DummyGetResponsePlugin; use OCA\DAV\Connector\Sabre\FakeLockerPlugin; use OCA\DAV\Connector\Sabre\FilesPlugin; +use OCA\DAV\Connector\Sabre\FilesReportPlugin; +use OCA\DAV\Connector\Sabre\SharesPlugin; use OCA\DAV\DAV\PublicAuth; use OCA\DAV\Connector\Sabre\QuotaPlugin; use OCA\DAV\Files\BrowserErrorPagePlugin; @@ -165,7 +168,7 @@ class Server { // custom properties plugin must be the last one $userSession = \OC::$server->getUserSession(); $user = $userSession->getUser(); - if (!is_null($user)) { + if ($user !== null) { $view = \OC\Files\Filesystem::getView(); $this->server->addPlugin( new FilesPlugin( @@ -187,9 +190,10 @@ class Server { ) ) ); - $this->server->addPlugin( - new QuotaPlugin($view) - ); + if ($view !== null) { + $this->server->addPlugin( + new QuotaPlugin($view)); + } $this->server->addPlugin( new TagsPlugin( $this->server->tree, \OC::$server->getTagManager() @@ -197,28 +201,29 @@ class Server { ); // TODO: switch to LazyUserFolder $userFolder = \OC::$server->getUserFolder(); - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin( + $this->server->addPlugin(new SharesPlugin( $this->server->tree, $userSession, $userFolder, \OC::$server->getShareManager() )); - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\CommentPropertiesPlugin( + $this->server->addPlugin(new CommentPropertiesPlugin( \OC::$server->getCommentsManager(), $userSession )); - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesReportPlugin( - $this->server->tree, - $view, - \OC::$server->getSystemTagManager(), - \OC::$server->getSystemTagObjectMapper(), - \OC::$server->getTagManager(), - $userSession, - \OC::$server->getGroupManager(), - $userFolder - )); + if ($view !== null) { + $this->server->addPlugin(new FilesReportPlugin( + $this->server->tree, + $view, + \OC::$server->getSystemTagManager(), + \OC::$server->getSystemTagObjectMapper(), + \OC::$server->getTagManager(), + $userSession, + \OC::$server->getGroupManager(), + $userFolder + )); + } } - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin()); }); } |