mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-13 17:24:54 +02:00
* moved admin pages to twig
* edited account.management.html.twig to fit modern templates, tibiacom have its own template * sample characters are now assigned to admin account and have group_id 4 to not be shown on highscores * fixed database pages loading * added require.database plugin option, which will prove if DATABASE_VERSION is enough
This commit is contained in:
19
index.php
19
index.php
@@ -50,11 +50,14 @@ else
|
||||
$uri = str_replace(array('index.php/', '?'), '', $uri);
|
||||
$uri = strtolower($uri);
|
||||
|
||||
$found = false;
|
||||
if(empty($uri) || isset($_REQUEST['template'])) {
|
||||
$_REQUEST['p'] = 'news';
|
||||
$found = true;
|
||||
}
|
||||
else if(file_exists(SYSTEM . 'pages/' . $uri . '.php')) {
|
||||
$_REQUEST['p'] = $uri;
|
||||
$found = true;
|
||||
}
|
||||
else {
|
||||
$rules = array(
|
||||
@@ -100,7 +103,6 @@ else {
|
||||
exit();
|
||||
}
|
||||
|
||||
$found = false;
|
||||
foreach($rules as $rule => $redirect) {
|
||||
if (preg_match($rule, $uri)) {
|
||||
$tmp = explode('/', $uri);
|
||||
@@ -118,15 +120,18 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
if(!$found) {
|
||||
$_REQUEST['p'] = '404';
|
||||
}
|
||||
if(!$found)
|
||||
$_REQUEST['p'] = $uri;
|
||||
}
|
||||
|
||||
// define page visited, so it can be used within events system
|
||||
$page = isset($_REQUEST['subtopic']) ? $_REQUEST['subtopic'] : (isset($_REQUEST['p']) ? $_REQUEST['p'] : '');
|
||||
if(empty($page) || preg_match('/[^A-z0-9_\-]/', $page))
|
||||
$page = 'news';
|
||||
if(empty($page) || preg_match('/[^A-z0-9_\-]/', $page)) {
|
||||
if(!$found)
|
||||
$page = '404';
|
||||
else
|
||||
$page = 'news';
|
||||
}
|
||||
|
||||
$page = strtolower($page);
|
||||
define('PAGE', $page);
|
||||
@@ -306,7 +311,7 @@ if($load_it)
|
||||
else
|
||||
{
|
||||
$file = SYSTEM . 'pages/' . $page . '.php';
|
||||
if(!@file_exists($file))
|
||||
if(!@file_exists($file) && !$found)
|
||||
{
|
||||
$page = '404';
|
||||
$file = SYSTEM . 'pages/404.php';
|
||||
|
Reference in New Issue
Block a user