aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/categories/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/ajax/categories/delete.php')
-rw-r--r--apps/contacts/ajax/categories/delete.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/apps/contacts/ajax/categories/delete.php b/apps/contacts/ajax/categories/delete.php
index bee2dbe3f6b..bc9f3e14e87 100644
--- a/apps/contacts/ajax/categories/delete.php
+++ b/apps/contacts/ajax/categories/delete.php
@@ -9,19 +9,9 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
+OCP\JSON::callCheck();
-foreach ($_POST as $key=>$element) {
- debug('_POST: '.$key.'=>'.print_r($element, true));
-}
-
-function bailOut($msg) {
- OCP\JSON::error(array('data' => array('message' => $msg)));
- OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG);
- exit();
-}
-function debug($msg) {
- OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG);
-}
+require_once __DIR__.'/../loghandler.php';
$categories = isset($_POST['categories'])?$_POST['categories']:null;
@@ -56,5 +46,3 @@ $catman->delete($categories, $cards);
debug('After delete: '.print_r($catman->categories(), true));
OC_Contacts_VCard::updateDataByID($cards);
OCP\JSON::success(array('data' => array('categories'=>$catman->categories())));
-
-?>