diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-11 21:52:39 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-12 15:14:23 +0100 |
commit | 1a74f0a18c799444d462c3d65ca348713bf89ad3 (patch) | |
tree | f0c6ee65526672687643f39640fffe3139c8103b /apps/contacts/lib/app.php | |
parent | c4ee924869fde31d41c47cd05d0f6c9ff4c16bdf (diff) | |
download | nextcloud-server-1a74f0a18c799444d462c3d65ca348713bf89ad3.tar.gz nextcloud-server-1a74f0a18c799444d462c3d65ca348713bf89ad3.zip |
Improve logging in OC_Contacts_App
Add logging to errors paths in getAddressbook and getContactObject.
Diffstat (limited to 'apps/contacts/lib/app.php')
-rw-r--r-- | apps/contacts/lib/app.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index f62bd311479..944bd6e83af 100644 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -49,6 +49,12 @@ class OC_Contacts_App{ public static function getAddressbook($id){ $addressbook = OC_Contacts_Addressbook::find( $id ); if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()){ + if ($addressbook === false) { + OC_Log::write('contacts', 'Addressbook not found: '. $id, OC_Log::ERROR); + } + else { + OC_Log::write('contacts', 'Addressbook('.$id.') is not from '.$OC_User::getUser(), OC_Log::ERROR); + } OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.')))); // Same here (as with the contact error). Could this error be improved? exit(); } @@ -58,11 +64,12 @@ class OC_Contacts_App{ public static function getContactObject($id){ $card = OC_Contacts_VCard::find( $id ); if( $card === false ){ + OC_Log::write('contacts', 'Contact could not be found: '.$id, OC_Log::ERROR); OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Contact could not be found.').' '.$id))); exit(); } - self::getAddressbook( $card['addressbookid'] ); + self::getAddressbook( $card['addressbookid'] );//access check return $card; } |