Move admin code to App\Admin class

Removed old myaac_admin_menu code
Add logged() + accountLogged() functions
This commit is contained in:
slawkens
2025-03-16 19:18:25 +01:00
parent 18ac8537c7
commit 8e86b8c015
15 changed files with 138 additions and 125 deletions

View File

@@ -1,13 +1,19 @@
<?php
use MyAAC\Services\LoginService;
define('MYAAC_ADMIN', true);
require '../../common.php';
require SYSTEM . 'functions.php';
require SYSTEM . 'init.php';
require SYSTEM . 'login.php';
if(!admin())
$loginService = new LoginService();
$loginService->checkLogin();
if(!admin()) {
die('Access denied.');
}
// Don't attempt to process the upload on an OPTIONS request
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {