summaryrefslogtreecommitdiff
path: root/public_html/api/index.php
blob: 54ae2cb99948291d4cb143db70c7145cfa751b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
    require_once( dirname(__FILE__) . "/../../lib/functions.php");

    // init frontend controller
    $controller = new kolab_admin_api_controller;

    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");

?>