mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-01 03:39:20 +02:00
Optimisations & fixes.
This commit is contained in:
parent
468f59fbec
commit
7008c9f4d8
@ -2,8 +2,8 @@
|
||||
// few things we'll need
|
||||
require '../common.php';
|
||||
|
||||
define('ADMIN_PANEL', true);
|
||||
define('MYAAC_ADMIN', true);
|
||||
const ADMIN_PANEL = true;
|
||||
const MYAAC_ADMIN = true;
|
||||
|
||||
if(file_exists(BASE . 'config.local.php')) {
|
||||
require_once BASE . 'config.local.php';
|
||||
@ -18,7 +18,7 @@ if(file_exists(BASE . 'install') && (!isset($config['installed']) || !$config['i
|
||||
$content = '';
|
||||
|
||||
// validate page
|
||||
$page = isset($_GET['p']) ? $_GET['p'] : '';
|
||||
$page = $_GET['p'] ?? '';
|
||||
if(empty($page) || preg_match("/[^a-zA-Z0-9_\-]/", $page))
|
||||
$page = 'dashboard';
|
||||
|
||||
@ -52,6 +52,9 @@ if(!$logged || !admin()) {
|
||||
$page = 'login';
|
||||
}
|
||||
|
||||
// more pages have action, lets define it here
|
||||
$action = $_REQUEST['action'] ?? '';
|
||||
|
||||
// include our page
|
||||
$file = SYSTEM . 'pages/admin/' . $page . '.php';
|
||||
if(!@file_exists($file)) {
|
||||
@ -68,4 +71,3 @@ ob_end_clean();
|
||||
// template
|
||||
$template_path = 'template/';
|
||||
require ADMIN . $template_path . 'template.php';
|
||||
?>
|
||||
|
@ -17,13 +17,13 @@ if (!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin()) {
|
||||
|
||||
$title = 'Changelog';
|
||||
$use_datatable = true;
|
||||
define('CL_LIMIT', 600); // maximum changelog body length
|
||||
const CL_LIMIT = 600; // maximum changelog body length
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL; ?>tools/css/jquery.datetimepicker.css"/ >
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.datetimepicker.js"></script>
|
||||
<?php
|
||||
$id = isset($_GET['id']) ? $_GET['id'] : 0;
|
||||
$id = $_GET['id'] ?? 0;
|
||||
require_once LIBS . 'changelog.php';
|
||||
|
||||
if(!empty($action))
|
||||
@ -111,14 +111,13 @@ if($action == 'edit' || $action == 'new') {
|
||||
$twig->display('admin.changelog.form.html.twig', array(
|
||||
'action' => $action,
|
||||
'cl_link_form' => constant('ADMIN_URL').'?p=changelog&action=' . ($action == 'edit' ? 'edit' : 'add'),
|
||||
'cl_id' => isset($id) ? $id : null,
|
||||
'cl_id' => $id ?? null,
|
||||
'body' => isset($body) ? htmlentities($body, ENT_COMPAT, 'UTF-8') : '',
|
||||
'create_date' => isset($create_date) ? $create_date : '',
|
||||
'player' => isset($player) && $player->isLoaded() ? $player : null,
|
||||
'player_id' => isset($player_id) ? $player_id : null,
|
||||
'create_date' => $create_date ?? '',
|
||||
'player_id' => $player_id ?? null,
|
||||
'account_players' => $account_players,
|
||||
'type' => isset($type) ? $type : 0,
|
||||
'where' => isset($where) ? $where : 0,
|
||||
'type' => $type ?? 0,
|
||||
'where' => $where ?? 0,
|
||||
'log_type' => $log_type,
|
||||
'log_where' => $log_where,
|
||||
));
|
||||
|
@ -10,8 +10,8 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Login';
|
||||
|
||||
$twig->display('admin.login.html.twig', array(
|
||||
'logout' => ($action == 'logout' ? 'You have been logged out!' : ''),
|
||||
$twig->display('admin.login.html.twig', [
|
||||
'logout' => (ACTION == 'logout' ? 'You have been logged out!' : ''),
|
||||
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
||||
'errors' => isset($errors)? $errors : ''
|
||||
));
|
||||
'errors' => $errors ?? ''
|
||||
]);
|
||||
|
@ -10,8 +10,8 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Changelog';
|
||||
|
||||
$_page = isset($_GET['page']) ? $_GET['page'] : 0;
|
||||
$id = isset($_GET['id']) ? $_GET['id'] : 0;
|
||||
$_page = $_GET['page'] ?? 0;
|
||||
$id = $_GET['id'] ?? 0;
|
||||
$limit = 30;
|
||||
$offset = $_page * $limit;
|
||||
$next_page = false;
|
||||
@ -43,4 +43,3 @@ $twig->display('changelog.html.twig', array(
|
||||
'next_page' => $next_page,
|
||||
'canEdit' => $canEdit,
|
||||
));
|
||||
?>
|
||||
|
@ -41,7 +41,7 @@ if($success) {
|
||||
$page = $uri;
|
||||
} else {
|
||||
// old support for pages like /?subtopic=accountmanagement
|
||||
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : (isset($_REQUEST['subtopic']) ? $_REQUEST['subtopic'] : '');
|
||||
$page = $_REQUEST['p'] ?? ($_REQUEST['subtopic'] ?? '');
|
||||
if(!empty($page) && preg_match('/^[A-z0-9\-]+$/', $page)) {
|
||||
if(config('backward_support')) {
|
||||
require SYSTEM . 'compat_pages.php';
|
||||
|
Loading…
x
Reference in New Issue
Block a user