diff options
Diffstat (limited to 'apps/dav/appinfo/app.php')
-rw-r--r-- | apps/dav/appinfo/app.php | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index 3651a5034c5..bc889176f7f 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -21,21 +21,7 @@ $cm = \OC::$server->getContactsManager(); $cm->register(function() use ($cm) { - $db = \OC::$server->getDatabaseConnection(); $userId = \OC::$server->getUserSession()->getUser()->getUID(); - $principal = new \OCA\DAV\Connector\Sabre\Principal( - \OC::$server->getUserManager() - ); - $cardDav = new \OCA\DAV\CardDAV\CardDavBackend($db, $principal, \OC::$server->getLogger()); - $addressBooks = $cardDav->getAddressBooksForUser("principals/$userId"); - foreach ($addressBooks as $addressBookInfo) { - $addressBook = new \OCA\DAV\CardDAV\AddressBook($cardDav, $addressBookInfo); - $cm->registerAddressBook( - new OCA\DAV\CardDAV\AddressBookImpl( - $addressBook, - $addressBookInfo, - $cardDav - ) - ); - } + $app = new \OCA\Dav\AppInfo\Application(); + $app->setupContactsProvider($cm, $userId); }); |