diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-10-06 21:21:38 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-10-06 21:21:38 +0200 |
commit | c30aa4ddebaefe93ec82f4f73d615a7ba1025e61 (patch) | |
tree | 1c5d1cd14533f193fa562ad450ce770f4cf816dd /apps/tasks/ajax/getdetails.php | |
parent | 16ee08385e2ff52c13fe25c1b4b6344e7cbdb813 (diff) | |
download | nextcloud-server-c30aa4ddebaefe93ec82f4f73d615a7ba1025e61.tar.gz nextcloud-server-c30aa4ddebaefe93ec82f4f73d615a7ba1025e61.zip |
Start using OC_JSON in tasks app
Diffstat (limited to 'apps/tasks/ajax/getdetails.php')
-rw-r--r-- | apps/tasks/ajax/getdetails.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/tasks/ajax/getdetails.php b/apps/tasks/ajax/getdetails.php index f111a399b36..08bf6c9ecf6 100644 --- a/apps/tasks/ajax/getdetails.php +++ b/apps/tasks/ajax/getdetails.php @@ -2,15 +2,11 @@ // Init owncloud require_once('../../../lib/base.php'); +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('tasks'); $l10n = new OC_L10N('tasks'); -// Check if we are a user -if( !OC_User::isLoggedIn()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => $l10n->t('You need to log in!')))); - exit(); -} - $id = $_GET['id']; $task = OC_Calendar_Object::find($id); $details = Sabre_VObject_Reader::read($task['calendardata'])->VTODO; @@ -22,4 +18,4 @@ $tmpl->assign('details',$details); $tmpl->assign('id',$id); $page = $tmpl->fetchPage(); -echo json_encode( array( 'status' => 'success', 'data' => array( 'id' => $id, 'page' => $page ))); +OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page ))); |