diff options
author | Jonathan Bauer | 2013-10-31 16:08:31 +0100 |
---|---|---|
committer | Jonathan Bauer | 2013-10-31 16:08:31 +0100 |
commit | 26cba45b4a28fd94386d064780a1daffbb351f7a (patch) | |
tree | b33f9261dedf58e7aee50ad9dc6079a957c87a1f /api.php | |
parent | Update sql creation statements aswell (diff) | |
download | slx-admin-26cba45b4a28fd94386d064780a1daffbb351f7a.tar.gz slx-admin-26cba45b4a28fd94386d064780a1daffbb351f7a.tar.xz slx-admin-26cba45b4a28fd94386d064780a1daffbb351f7a.zip |
Tolle neue APIs Sachen
Diffstat (limited to 'api.php')
-rw-r--r-- | api.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/api.php b/api.php new file mode 100644 index 00000000..9491cd37 --- /dev/null +++ b/api.php @@ -0,0 +1,31 @@ +<?php + +error_reporting(E_ALL); + +require_once('inc/user.inc.php'); +require_once('inc/util.inc.php'); +require_once('inc/db.inc.php'); +require_once('inc/permission.inc.php'); +require_once('inc/crypto.inc.php'); +require_once('inc/validator.inc.php'); + +if (empty($_REQUEST['do'])) { + // No specific module - set default + $module = 'main'; +} else { + $module = preg_replace('/[^a-z]/', '', $_REQUEST['do']); +} + +$module = 'apis/' . $module . '.inc.php'; + +if (!file_exists($module)) { + Util::traceError('Invalid module: ' . $module); +} + +Header('Content-Type: text/plain; charset=utf-8'); + +// Load module - it will execute pre-processing, or act upon request parameters +require_once($module); +unset($module); + + |