diff options
author | Björn Schießle <bjoern@schiessle.org> | 2015-11-25 15:24:50 +0100 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2015-12-15 14:52:27 +0100 |
commit | cd55a19034750a13f242f1fa59151b8894193173 (patch) | |
tree | 942dde009a8c2adc21cc69fd15a8b000d4bd2638 /apps/dav/appinfo/app.php | |
parent | 32525fa9771a73e2bdd260ac38527afb9960d88a (diff) | |
download | nextcloud-server-cd55a19034750a13f242f1fa59151b8894193173.tar.gz nextcloud-server-cd55a19034750a13f242f1fa59151b8894193173.zip |
implement delete, create, update, search, get permissions
Diffstat (limited to 'apps/dav/appinfo/app.php')
-rw-r--r-- | apps/dav/appinfo/app.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index 0a54df19c72..950754ee941 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -23,9 +23,20 @@ $cm = \OC::$server->getContactsManager(); $cm->register(function() use ($cm) { $db = \OC::$server->getDatabaseConnection(); $userId = \OC::$server->getUserSession()->getUser()->getUID(); - $cardDav = new \OCA\DAV\CardDAV\CardDavBackend($db); + $principal = new \OCA\DAV\Connector\Sabre\Principal( + \OC::$server->getConfig(), + \OC::$server->getUserManager() + ); + $cardDav = new \OCA\DAV\CardDAV\CardDavBackend($db, $principal, \OC::$server->getLogger()); $addressBooks = $cardDav->getAddressBooksForUser("principals/$userId"); - foreach ($addressBooks as $addressBook) { - $cm->registerAddressBook(new OCA\DAV\CardDAV\AddressBookImpl($addressBook)); + foreach ($addressBooks as $addressBookInfo) { + $addressBook = new \OCA\DAV\CardDAV\AddressBook($cardDav, $addressBookInfo); + $cm->registerAddressBook( + new OCA\DAV\CardDAV\AddressBookImpl( + $addressBook, + $addressBookInfo, + $cardDav + ) + ); } }); |