diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-06-24 22:22:58 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-06-24 22:25:32 +0200 |
commit | 3afbc3d2dc3c36145411926f1b59de0401fe6876 (patch) | |
tree | 6709de4a0a93c470f71906336e15938cceb2e7ca /apps/contacts/ajax/deleteproperty.php | |
parent | f10c51193b0b661a187490f584cc41fbc7a67f01 (diff) | |
download | nextcloud-server-3afbc3d2dc3c36145411926f1b59de0401fe6876.tar.gz nextcloud-server-3afbc3d2dc3c36145411926f1b59de0401fe6876.zip |
Add some DRYness to logging.
Diffstat (limited to 'apps/contacts/ajax/deleteproperty.php')
-rw-r--r-- | apps/contacts/ajax/deleteproperty.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index 55f7e323083..90e5e64903e 100644 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -24,6 +24,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::callCheck(); +require_once('loghandler.php'); $id = $_POST['id']; $checksum = $_POST['checksum']; @@ -31,16 +32,14 @@ $checksum = $_POST['checksum']; $vcard = OC_Contacts_App::getContactVCard( $id ); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); if(is_null($line)){ - OCP\JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')))); + bailOut(OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')); exit(); } unset($vcard->children[$line]); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.')))); - OCP\Util::writeLog('contacts','ajax/deleteproperty.php: Error deleting contact property', OCP\Util::ERROR); - exit(); + bailOut(OC_Contacts_App::$l10n->t('Error deleting contact property.')); } OCP\JSON::success(array('data' => array( 'id' => $id ))); |