summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
commitd0060968b77c39bdf8abffb071c971c166b59edb (patch)
tree0be52e00a25bd298235a0cf916fb07496d3ab95f /index.php
downloadBits-d0060968b77c39bdf8abffb071c971c166b59edb.tar.gz
Bits-d0060968b77c39bdf8abffb071c971c166b59edb.zip
First commit.
Diffstat (limited to 'index.php')
-rw-r--r--index.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..57ff020
--- /dev/null
+++ b/index.php
@@ -0,0 +1,32 @@
+<?php
+header("HTTP/1.1 200 OK");
+require("lib/conf/apps.php");
+require("lib/functions.php");
+
+if (isset($_GET["p"])) {
+ $args = $_GET['p'];
+} else {
+ $args = explode('/', $_SERVER['REQUEST_URI']);
+ $args = $args[count($args) - 1];
+ $args = explode('?', $args);
+ if (count($args) == 2) $_GET[$args[1]] = 0;
+ $args = $args[0];
+ if ($args == "" or $args == "index.php") $args = $homepage;
+}
+$args = explode('-', $args);
+if (count($args) == 1) $args = array("index", $args[0]);
+$url = implode('-', $args);
+token_clear();
+
+if (isset($apps[$args[1]])) {
+ if (isset($apps[$args[1]][$args[0]])) {
+ $priv_required = $apps[$args[1]][$args[0]];
+ require("lib/login.php");
+ token_clear();
+ require("lib/" . $args[1] . "/" . $args[0] . ".php");
+ }
+}
+
+$title = "Not found";
+$error = "This page does not exist.";
+require("tpl/general/empty.php");