diff options
Diffstat (limited to 'apps/contacts/lib/app.php')
-rw-r--r-- | apps/contacts/lib/app.php | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index b59a8372b74..f6ce213c49b 100644 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -37,21 +37,24 @@ class OC_Contacts_App { ) ) ); - } - else { - OCP\Util::writeLog('contacts', - 'Addressbook('.$id.') is not from '.OCP\USER::getUser(), - OCP\Util::ERROR); - //throw new Exception('This is not your addressbook.'); - OCP\JSON::error( - array( - 'data' => array( - 'message' => self::$l10n->t('This is not your addressbook.') + } else { + $sharedAddressbook = OCP\Share::getItemSharedWithBySource('addressbook', $id, OC_Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS); + if ($sharedAddressbook) { + return $sharedAddressbook; + } else { + OCP\Util::writeLog('contacts', + 'Addressbook('.$id.') is not from '.OCP\USER::getUser(), + OCP\Util::ERROR); + //throw new Exception('This is not your addressbook.'); + OCP\JSON::error( + array( + 'data' => array( + 'message' => self::$l10n->t('This is not your addressbook.') + ) ) - ) - ); + ); + } } - exit(); } return $addressbook; } |