diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/contacts/index.php | 1 | ||||
-rw-r--r-- | apps/contacts/lib/addressbook.php | 2 | ||||
-rw-r--r-- | apps/contacts/lib/app.php | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/apps/contacts/index.php b/apps/contacts/index.php index e72d2917ead..0b4f89b30c0 100644 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -20,7 +20,6 @@ if($contacts === false) { } $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser()); -$addressbooks = array_merge($addressbooks, OCP\Share::getItemsSharedWith('addressbook', OC_Contacts_Share::FORMAT_ADDRESSBOOKS)); // Load the files we need OCP\App::setActiveNavigationEntry( 'contacts_index' ); diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index 86a41b18cf3..afbf1d59201 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -58,7 +58,7 @@ class OC_Contacts_Addressbook{ while( $row = $result->fetchRow()){ $addressbooks[] = $row; } - + $addressbooks = array_merge($addressbooks, OCP\Share::getItemsSharedWith('addressbook', OC_Contacts_Share::FORMAT_ADDRESSBOOKS)); return $addressbooks; } diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index 29428763d60..ce66624c8f9 100644 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -24,7 +24,7 @@ class OC_Contacts_App { public static function getAddressbook($id) { $addressbook = OC_Contacts_Addressbook::find( $id ); - if( $addressbook === false || $addressbook['userid'] != OCP\USER::getUser()) { + if( $addressbook === false || $addressbook['userid'] != OCP\USER::getUser() && !OCP\Share::getItemSharedWithBySource('addressbook', $id)) { if ($addressbook === false) { OCP\Util::writeLog('contacts', 'Addressbook not found: '. $id, OCP\Util::ERROR); OCP\JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.')))); |