diff --git a/appinfo/app.php b/appinfo/app.php index 4dc70a9f..705d65ba 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -25,10 +25,13 @@ OCP\App::addNavigationEntry( array( 'name' => OC_L10N::get('contacts')->t('Contacts') )); OCP\Util::addscript('contacts', 'loader'); -OC_Search::registerProvider('OCA\Contacts\SearchProvider'); -OCP\Share::registerBackend('contact', 'OCA\Contacts\Share_Backend_Contact'); -OCP\Share::registerBackend('addressbook', 'OCA\Contacts\Share_Backend_Addressbook', 'contact'); -foreach(OCA\Contacts\Addressbook::all(OCP\USER::getUser()) as $addressbook) { - OCP\Contacts::registerAddressBook(new OCA\Contacts\AddressbookProvider($addressbook['id'])); +if(OCP\User::isLoggedIn()) { + OC_Search::registerProvider('OCA\Contacts\SearchProvider'); + OCP\Share::registerBackend('contact', 'OCA\Contacts\Share_Backend_Contact'); + OCP\Share::registerBackend('addressbook', 'OCA\Contacts\Share_Backend_Addressbook', 'contact'); + + foreach(OCA\Contacts\Addressbook::all(OCP\USER::getUser()) as $addressbook) { + OCP\Contacts::registerAddressBook(new OCA\Contacts\AddressbookProvider($addressbook['id'])); + } }