28 lines
1001 B
PHP
28 lines
1001 B
PHP
<?php
|
|
|
|
/*
|
|
* SPDX-FileCopyrightText: Copyright 2020 - 2026 grommunio GmbH
|
|
* SPDX-FileCopyrightText: Copyright 2016 Kopano and its licensors
|
|
* SPDX-FileCopyrightText: Copyright 2005 - 2016 Zarafa B.V. and its licensors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
/*
|
|
* This controller script handles REST requests. Every request needs its own controller script
|
|
* to handle the request. This script will only check if a controller for the request
|
|
* exists, and if so it will delegate control to that script. If a controller for the
|
|
* request can not be found, this script will respond with
|
|
* 404 Not Found
|
|
*
|
|
*/
|
|
|
|
require_once BASE_PATH . 'server/includes/core/class.response.php';
|
|
|
|
$service = $_GET['service'] ?? null;
|
|
if (!is_string($service) || preg_match('/\A[a-z]+\z/D', $service) !== 1 ||
|
|
!file_exists(BASE_PATH . 'server/includes/controllers/service.' . $service . '.php')) {
|
|
Response::notFound();
|
|
}
|
|
|
|
include BASE_PATH . 'server/includes/controllers/service.' . $service . '.php';
|