public function __construct() { $config = \OC::$server->getConfig(); $db = \OC::$server->getDatabaseConnection(); $dispatcher = \OC::$server->getEventDispatcher(); $userPrincipalBackend = new Principal(\OC::$server->getUserManager(), \OC::$server->getGroupManager()); $groupPrincipalBackend = new GroupPrincipalBackend(\OC::$server->getGroupManager()); // as soon as debug mode is enabled we allow listing of principals $disableListing = !$config->getSystemValue('debug', false); // setup the first level of the dav tree $userPrincipals = new Collection($userPrincipalBackend, 'principals/users'); $userPrincipals->disableListing = $disableListing; $groupPrincipals = new Collection($groupPrincipalBackend, 'principals/groups'); $groupPrincipals->disableListing = $disableListing; $systemPrincipals = new Collection(new SystemPrincipalBackend(), 'principals/system'); $systemPrincipals->disableListing = $disableListing; $filesCollection = new Files\RootCollection($userPrincipalBackend, 'principals/users'); $filesCollection->disableListing = $disableListing; $caldavBackend = new CalDavBackend($db, $userPrincipalBackend); $calendarRoot = new CalendarRoot($userPrincipalBackend, $caldavBackend, 'principals/users'); $calendarRoot->disableListing = $disableListing; $systemTagCollection = new SystemTag\SystemTagsByIdCollection(\OC::$server->getSystemTagManager(), \OC::$server->getUserSession(), \OC::$server->getGroupManager()); $systemTagRelationsCollection = new SystemTag\SystemTagsRelationsCollection(\OC::$server->getSystemTagManager(), \OC::$server->getSystemTagObjectMapper(), \OC::$server->getUserSession(), \OC::$server->getGroupManager(), \OC::$server->getRootFolder()); $commentsCollection = new Comments\RootCollection(\OC::$server->getCommentsManager(), \OC::$server->getUserManager(), \OC::$server->getUserSession(), \OC::$server->getEventDispatcher(), \OC::$server->getLogger()); $usersCardDavBackend = new CardDavBackend($db, $userPrincipalBackend, $dispatcher); $usersAddressBookRoot = new AddressBookRoot($userPrincipalBackend, $usersCardDavBackend, 'principals/users'); $usersAddressBookRoot->disableListing = $disableListing; $systemCardDavBackend = new CardDavBackend($db, $userPrincipalBackend, $dispatcher); $systemAddressBookRoot = new AddressBookRoot(new SystemPrincipalBackend(), $systemCardDavBackend, 'principals/system'); $systemAddressBookRoot->disableListing = $disableListing; $uploadCollection = new Upload\RootCollection($userPrincipalBackend, 'principals/users'); $uploadCollection->disableListing = $disableListing; $children = [new SimpleCollection('principals', [$userPrincipals, $groupPrincipals, $systemPrincipals]), $filesCollection, $calendarRoot, new SimpleCollection('addressbooks', [$usersAddressBookRoot, $systemAddressBookRoot]), $systemTagCollection, $systemTagRelationsCollection, $commentsCollection, $uploadCollection]; parent::__construct('root', $children); }
public function __construct() { $applications = is_object(Tinebase_Core::getUser()) ? Tinebase_Core::getUser()->getApplications() : new Tinebase_Record_RecordSet('Tinebase_Model_Application'); parent::__construct('root', array(new \Sabre\DAV\SimpleCollection('principals', array(new Tinebase_WebDav_PrincipalCollection(new Tinebase_WebDav_PrincipalBackend(), Tinebase_WebDav_PrincipalBackend::PREFIX_USERS), new Tinebase_WebDav_PrincipalCollection(new Tinebase_WebDav_PrincipalBackend(), Tinebase_WebDav_PrincipalBackend::PREFIX_GROUPS), new Tinebase_WebDav_PrincipalCollection(new Tinebase_WebDav_PrincipalBackend(), Tinebase_WebDav_PrincipalBackend::PREFIX_INTELLIGROUPS))))); if ($applications->find('name', 'Calendar')) { $this->addChild(new Calendar_Frontend_WebDAV(\Sabre\CalDAV\Plugin::CALENDAR_ROOT, true)); } if ($applications->find('name', 'Tasks')) { $this->addChild(new Tasks_Frontend_WebDAV('tasks', true)); } if ($applications->find('name', 'Addressbook')) { $this->addChild(new Addressbook_Frontend_WebDAV(\Sabre\CardDAV\Plugin::ADDRESSBOOK_ROOT, true)); } // main entry point for ownCloud if ($applications->find('name', 'Filemanager')) { $this->addChild(new \Sabre\DAV\SimpleCollection('remote.php', array(new Filemanager_Frontend_WebDAV('webdav')))); } // webdav tree $webDAVCollection = new \Sabre\DAV\SimpleCollection('webdav'); foreach ($applications as $application) { $applicationClass = $application->name . '_Frontend_WebDAV'; if (@class_exists($applicationClass)) { $webDAVCollection->addChild(new $applicationClass($application->name)); } } $this->addChild($webDAVCollection); }
public function __construct() { $config = \OC::$server->getConfig(); $db = \OC::$server->getDatabaseConnection(); $principalBackend = new Principal($config, \OC::$server->getUserManager()); // as soon as debug mode is enabled we allow listing of principals $disableListing = !$config->getSystemValue('debug', false); // setup the first level of the dav tree $userPrincipals = new Collection($principalBackend, 'principals/users'); $userPrincipals->disableListing = $disableListing; $systemPrincipals = new Collection(new SystemPrincipalBackend(), 'principals/system'); $systemPrincipals->disableListing = $disableListing; $filesCollection = new Files\RootCollection($principalBackend, 'principals/users'); $filesCollection->disableListing = $disableListing; $caldavBackend = new CalDavBackend($db); $calendarRoot = new CalendarRoot($principalBackend, $caldavBackend, 'principals/users'); $calendarRoot->disableListing = $disableListing; $usersCardDavBackend = new CardDavBackend($db, $principalBackend); $usersAddressBookRoot = new AddressBookRoot($principalBackend, $usersCardDavBackend, 'principals/users'); $usersAddressBookRoot->disableListing = $disableListing; $systemCardDavBackend = new CardDavBackend($db, $principalBackend); $systemAddressBookRoot = new AddressBookRoot(new SystemPrincipalBackend(), $systemCardDavBackend, 'principals/system'); $systemAddressBookRoot->disableListing = $disableListing; $children = [new SimpleCollection('principals', [$userPrincipals, $systemPrincipals]), $filesCollection, $calendarRoot, new SimpleCollection('addressbooks', [$usersAddressBookRoot, $systemAddressBookRoot])]; parent::__construct('root', $children); }
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); }
public function __construct() { $config = \OC::$server->getConfig(); $principalBackend = new Principal($config, \OC::$server->getUserManager()); // as soon as debug mode is enabled we allow listing of principals $disableListing = !$config->getSystemValue('debug', false); // setup the first level of the dav tree $principalCollection = new Collection($principalBackend); $principalCollection->disableListing = $disableListing; $filesCollection = new Files\RootCollection($principalBackend); $filesCollection->disableListing = $disableListing; $children = [$principalCollection, $filesCollection]; parent::__construct('root', $children); }
public function __construct() { $config = \OC::$server->getConfig(); $db = \OC::$server->getDatabaseConnection(); $principalBackend = new Principal($config, \OC::$server->getUserManager()); // as soon as debug mode is enabled we allow listing of principals $disableListing = !$config->getSystemValue('debug', false); // setup the first level of the dav tree $principalCollection = new Collection($principalBackend); $principalCollection->disableListing = $disableListing; $filesCollection = new Files\RootCollection($principalBackend); $filesCollection->disableListing = $disableListing; $caldavBackend = new CalDavBackend($db); $calendarRoot = new CalendarRoot($principalBackend, $caldavBackend); $calendarRoot->disableListing = $disableListing; $cardDavBackend = new CardDavBackend(\OC::$server->getDatabaseConnection(), $principalBackend); $addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend); $addressBookRoot->disableListing = $disableListing; $children = [$principalCollection, $filesCollection, $calendarRoot, $addressBookRoot]; parent::__construct('root', $children); }
/** * SystemTagsRelationsCollection constructor. * * @param ISystemTagManager $tagManager * @param ISystemTagObjectMapper $tagMapper * @param IUserSession $userSession * @param IGroupManager $groupManager * @param IRootFolder $fileRoot */ public function __construct(ISystemTagManager $tagManager, ISystemTagObjectMapper $tagMapper, IUserSession $userSession, IGroupManager $groupManager, IRootFolder $fileRoot) { $children = [new SystemTagsObjectTypeCollection('files', $tagManager, $tagMapper, $userSession, $groupManager, $fileRoot)]; parent::__construct('root', $children); }
function __construct($type) { $this->type = $type; parent::__construct('root'); }
/** * SystemTagsRelationsCollection constructor. * * @param ISystemTagManager $tagManager * @param ISystemTagObjectMapper $tagMapper */ public function __construct($tagManager, $tagMapper) { $children = [new SystemTagsObjectTypeCollection('files', $tagManager, $tagMapper)]; parent::__construct('root', $children); }
/** * Constructor. * * @params array $children Children. */ function __construct(array $children) { parent::__construct(self::NAME, $children); }