summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/rootcollection.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/rootcollection.php')
-rw-r--r--apps/dav/lib/rootcollection.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/dav/lib/rootcollection.php b/apps/dav/lib/rootcollection.php
index 11fdc7c9605..c1635c9cde5 100644
--- a/apps/dav/lib/rootcollection.php
+++ b/apps/dav/lib/rootcollection.php
@@ -34,10 +34,13 @@ class RootCollection extends SimpleCollection {
$calendarRoot = new CalendarRoot($principalBackend, $caldavBackend, 'principals/users');
$calendarRoot->disableListing = $disableListing;
- $cardDavBackend = new CardDavBackend(\OC::$server->getDatabaseConnection(), $principalBackend);
+ $usersCardDavBackend = new CardDavBackend($db, $principalBackend);
+ $usersAddressBookRoot = new AddressBookRoot($principalBackend, $usersCardDavBackend, 'principals/users');
+ $usersAddressBookRoot->disableListing = $disableListing;
- $addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend, 'principals/users');
- $addressBookRoot->disableListing = $disableListing;
+ $systemCardDavBackend = new CardDavBackend($db, $principalBackend);
+ $systemAddressBookRoot = new AddressBookRoot(new SystemPrincipalBackend(), $systemCardDavBackend, 'principals/system');
+ $systemAddressBookRoot->disableListing = $disableListing;
$children = [
new SimpleCollection('principals', [
@@ -45,7 +48,9 @@ class RootCollection extends SimpleCollection {
$systemPrincipals]),
$filesCollection,
$calendarRoot,
- $addressBookRoot,
+ new SimpleCollection('addressbooks', [
+ $usersAddressBookRoot,
+ $systemAddressBookRoot]),
];
parent::__construct('root', $children);