diff options
Diffstat (limited to 'apps/dav/lib/rootcollection.php')
-rw-r--r-- | apps/dav/lib/rootcollection.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/dav/lib/rootcollection.php b/apps/dav/lib/rootcollection.php new file mode 100644 index 00000000000..62ec3219caa --- /dev/null +++ b/apps/dav/lib/rootcollection.php @@ -0,0 +1,29 @@ +<?php + +namespace OCA\DAV; + +use OCA\DAV\Connector\Sabre\Principal; +use Sabre\CalDAV\Principal\Collection; +use Sabre\DAV\SimpleCollection; + +class RootCollection extends SimpleCollection { + + public function __construct() { + $principalBackend = new Principal( + \OC::$server->getConfig(), + \OC::$server->getUserManager() + ); + $principalCollection = new Collection($principalBackend); + $principalCollection->disableListing = true; + $filesCollection = new Files\RootCollection($principalBackend); + $filesCollection->disableListing = true; + + $children = [ + $principalCollection, + $filesCollection, + ]; + + parent::__construct('root', $children); + } + +} |