diff options
Diffstat (limited to 'apps/tasks/ajax/addtaskform.php')
-rw-r--r-- | apps/tasks/ajax/addtaskform.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/tasks/ajax/addtaskform.php b/apps/tasks/ajax/addtaskform.php index 297c590060d..222ccbd79a3 100644 --- a/apps/tasks/ajax/addtaskform.php +++ b/apps/tasks/ajax/addtaskform.php @@ -2,18 +2,14 @@ // 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(); -} - $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), true); $tmpl = new OC_Template('tasks','part.addtaskform'); $tmpl->assign('calendars',$calendars); $page = $tmpl->fetchPage(); -echo json_encode( array( 'status' => 'success', 'data' => array( 'page' => $page ))); +OC_JSON::success(array('data' => array( 'page' => $page ))); |