summaryrefslogtreecommitdiffstats
path: root/public_html/api/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'public_html/api/index.php')
-rw-r--r--public_html/api/index.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/public_html/api/index.php b/public_html/api/index.php
index 54ae2cb..1349a1c 100644
--- a/public_html/api/index.php
+++ b/public_html/api/index.php
@@ -1,18 +1,19 @@
<?php
- require_once( dirname(__FILE__) . "/../../lib/functions.php");
- // init frontend controller
- $controller = new kolab_admin_api_controller;
+require_once dirname(__FILE__) . "/../../lib/functions.php";
- try {
- $postdata = $_SERVER['REQUEST_METHOD'] == 'POST' ? @json_decode(file_get_contents('php://input'), true) : null;
- $controller->dispatch($postdata);
- } catch(Exception $e) {
- error_log($e->getMessage());
- $controller->output->error($e->getMessage(), $e->getCode());
- }
+// init frontend controller
+$controller = new kolab_admin_api_controller;
- // if we arrive here the controller didn't generate output
- $controller->output->error("Invalid request");
+try {
+ $postdata = $_SERVER['REQUEST_METHOD'] == 'POST' ? @json_decode(file_get_contents('php://input'), true) : null;
+ $controller->dispatch($postdata);
+} catch(Exception $e) {
+ error_log($e->getMessage());
+ $controller->output->error($e->getMessage(), $e->getCode());
+}
+
+// if we arrive here the controller didn't generate output
+$controller->output->error("Invalid request");
?>