diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-09-23 22:22:59 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-09-25 22:19:28 +0200 |
commit | 17e631bc5e327514596ce8761fe7f93d414a8717 (patch) | |
tree | a2e6bed923a493988028adafaaebcab5b9bfbd39 /apps/calendar/ajax/deletecalendar.php | |
parent | dbddec9160338818009ec7020cec5a2b298aae7e (diff) | |
download | nextcloud-server-17e631bc5e327514596ce8761fe7f93d414a8717.tar.gz nextcloud-server-17e631bc5e327514596ce8761fe7f93d414a8717.zip |
Use OC_JSON for json responses
Create OC_JSON class, for single point of creating json responses.
No real logic change, this just cleans up the code a bit.
Diffstat (limited to 'apps/calendar/ajax/deletecalendar.php')
-rw-r--r-- | apps/calendar/ajax/deletecalendar.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/calendar/ajax/deletecalendar.php b/apps/calendar/ajax/deletecalendar.php index 71129f2c040..30607b92e6f 100644 --- a/apps/calendar/ajax/deletecalendar.php +++ b/apps/calendar/ajax/deletecalendar.php @@ -16,13 +16,13 @@ if(!OC_USER::isLoggedIn()) { $cal = $_POST["calendarid"]; $calendar = OC_Calendar_Calendar::findCalendar($cal); if($calendar["userid"] != OC_User::getUser()){ - echo json_encode(array('status'=>'error','error'=>'permission_denied')); + OC_JSON::error(array('error'=>'permission_denied')); exit; } $del = OC_Calendar_Calendar::deleteCalendar($cal); if($del == true){ - echo json_encode(array('status' => 'success')); + OC_JSON::success(); }else{ - echo json_encode(array('status'=>'error', 'error'=>'dberror')); + OC_JSON::error(array('error'=>'dberror')); } ?> |