mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-23 21:30:14 +02:00
Configurable admin panel folder
This commit is contained in:
parent
3700875c47
commit
577f9b7373
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// few things we'll need
|
||||
require '../common.php';
|
||||
|
||||
@ -42,7 +43,7 @@ $hooks->load();
|
||||
require SYSTEM . 'status.php';
|
||||
require SYSTEM . 'login.php';
|
||||
require SYSTEM . 'migrate.php';
|
||||
require ADMIN . 'includes/functions.php';
|
||||
require __DIR__ . '/includes/functions.php';
|
||||
|
||||
$twig->addGlobal('config', $config);
|
||||
$twig->addGlobal('status', $status);
|
||||
@ -57,7 +58,7 @@ if(!$logged || !admin()) {
|
||||
}
|
||||
|
||||
// include our page
|
||||
$file = BASE . 'admin/pages/' . $page . '.php';
|
||||
$file = __DIR__ . '/pages/' . $page . '.php';
|
||||
if(!@file_exists($file)) {
|
||||
if (strpos($page, 'plugins/') !== false) {
|
||||
$file = BASE . $page;
|
||||
@ -76,4 +77,4 @@ ob_end_clean();
|
||||
|
||||
// template
|
||||
$template_path = 'template/';
|
||||
require ADMIN . $template_path . 'template.php';
|
||||
require __DIR__ . '/' . $template_path . 'template.php';
|
||||
|
@ -64,9 +64,14 @@ const NEWS = 1;
|
||||
const TICKER = 2;
|
||||
const ARTICLE = 3;
|
||||
|
||||
// here you can change location of admin panel
|
||||
// you need also to rename folder "admin"
|
||||
// this may improve security
|
||||
const ADMIN_PANEL_FOLDER = 'admin';
|
||||
|
||||
// directories
|
||||
const BASE = __DIR__ . '/';
|
||||
const ADMIN = BASE . 'admin/';
|
||||
const ADMIN = BASE . ADMIN_PANEL_FOLDER . '/';
|
||||
const SYSTEM = BASE . 'system/';
|
||||
const CACHE = SYSTEM . 'cache/';
|
||||
const LOCALE = SYSTEM . 'locale/';
|
||||
@ -117,7 +122,7 @@ $size = count($tmp) - 1;
|
||||
for($i = 1; $i < $size; $i++)
|
||||
$basedir .= '/' . $tmp[$i];
|
||||
|
||||
$basedir = str_replace(['/admin', '/install', '/tools'], '', $basedir);
|
||||
$basedir = str_replace(['/' . ADMIN_PANEL_FOLDER, '/install', '/tools'], '', $basedir);
|
||||
define('BASE_DIR', $basedir);
|
||||
|
||||
if(!IS_CLI) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user