mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
Contacts: Check for logged in state before registering backends. Fix #743
This commit is contained in:
parent
69ba5225be
commit
5b5002b333
@ -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']));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user