mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* fixed include template dir on admin page
* also fixed line separator on admin/index.php
This commit is contained in:
parent
b62ce7ec6f
commit
91c3b343e7
@ -1 +1,49 @@
|
|||||||
<?php
// few things we'll need
require('../common.php');
require_once(BASE . 'config.local.php');
if(file_exists(BASE . 'install') && (!isset($config['installed']) || !$config['installed']))
{
header('Location: ' . BASE_URL . 'install/');
die('Setup detected that <b>install/</b> directory exists. Please visit <a href="' . BASE_URL . 'install">this</a> url to start MyAAC Installation.<br/>Delete <b>install/</b> directory if you already installed MyAAC.<br/>Remember to REFRESH this page when you\'re done!');
}
$content = '';
// validate page
$page = isset($_GET['p']) ? $_GET['p'] : '';
if(empty($page) || preg_match("/[^a-zA-Z0-9_\-]/", $page))
$page = 'dashboard';
$page = strtolower($page);
define('PAGE', $page);
require(SYSTEM . 'functions.php');
require(SYSTEM . 'init.php');
require(SYSTEM . 'status.php');
require(SYSTEM . 'login.php');
require(ADMIN . 'includes/functions.php');
// if we're not logged in - show login box
if(!$logged || !admin()) {
$page = 'login';
}
// include our page
$file = SYSTEM . 'pages/admin/' . $page . '.php';
if(!@file_exists($file)) {
$page = '404';
$file = SYSTEM . 'pages/404.php';
}
ob_start();
include($file);
$content .= ob_get_contents();
ob_end_clean();
// template
$template_path = 'templates/clean/';
require(ADMIN . $template_path . 'template.php');
?>
|
<?php
|
||||||
|
// few things we'll need
|
||||||
|
require('../common.php');
|
||||||
|
require_once(BASE . 'config.local.php');
|
||||||
|
|
||||||
|
if(file_exists(BASE . 'install') && (!isset($config['installed']) || !$config['installed']))
|
||||||
|
{
|
||||||
|
header('Location: ' . BASE_URL . 'install/');
|
||||||
|
die('Setup detected that <b>install/</b> directory exists. Please visit <a href="' . BASE_URL . 'install">this</a> url to start MyAAC Installation.<br/>Delete <b>install/</b> directory if you already installed MyAAC.<br/>Remember to REFRESH this page when you\'re done!');
|
||||||
|
}
|
||||||
|
|
||||||
|
$content = '';
|
||||||
|
|
||||||
|
// validate page
|
||||||
|
$page = isset($_GET['p']) ? $_GET['p'] : '';
|
||||||
|
if(empty($page) || preg_match("/[^a-zA-Z0-9_\-]/", $page))
|
||||||
|
$page = 'dashboard';
|
||||||
|
|
||||||
|
$page = strtolower($page);
|
||||||
|
define('PAGE', $page);
|
||||||
|
|
||||||
|
require(SYSTEM . 'functions.php');
|
||||||
|
require(SYSTEM . 'init.php');
|
||||||
|
require(SYSTEM . 'status.php');
|
||||||
|
require(SYSTEM . 'login.php');
|
||||||
|
require(ADMIN . 'includes/functions.php');
|
||||||
|
|
||||||
|
// if we're not logged in - show login box
|
||||||
|
if(!$logged || !admin()) {
|
||||||
|
$page = 'login';
|
||||||
|
}
|
||||||
|
|
||||||
|
// include our page
|
||||||
|
$file = SYSTEM . 'pages/admin/' . $page . '.php';
|
||||||
|
if(!@file_exists($file)) {
|
||||||
|
$page = '404';
|
||||||
|
$file = SYSTEM . 'pages/404.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
include($file);
|
||||||
|
|
||||||
|
$content .= ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
|
// template
|
||||||
|
$template_path = 'template/';
|
||||||
|
require(ADMIN . $template_path . 'template.php');
|
||||||
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user