summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/deleteproperty.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-24 22:22:58 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-24 22:25:32 +0200
commit3afbc3d2dc3c36145411926f1b59de0401fe6876 (patch)
tree6709de4a0a93c470f71906336e15938cceb2e7ca /apps/contacts/ajax/deleteproperty.php
parentf10c51193b0b661a187490f584cc41fbc7a67f01 (diff)
downloadnextcloud-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.php7
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 )));