mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
All admin pages refactored to thin controllers + pure view templates, mirroring the public-page pattern: Controllers (public/admin/*.php): auth, data loading, include template Views (templates/admin/*.php): pure HTML/PHP output Fragment partials (templates/admin/partials/): toast, system-log-panel, system-nginx-config-panel Pages migrated: login, tags, contenus, contenus-edit, account, acces-etudiante, thanks, add, edit, parametres, system, index Fragment endpoints refactored: system-fragment.php, toast-fragment.php Skipped (pure redirects): logout, logs, status, import
28 lines
905 B
PHP
28 lines
905 B
PHP
<?php
|
|
require_once __DIR__ . "/../../bootstrap.php";
|
|
require_once __DIR__ . '/../../src/AdminAuth.php';
|
|
AdminAuth::requireLogin();
|
|
|
|
$pageTitle = "Paramètres";
|
|
|
|
$hasPassword = AdminAuth::hasPassword();
|
|
$maintenanceOn = file_exists(APP_ROOT . '/storage/maintenance.flag');
|
|
|
|
require_once APP_ROOT . '/src/Database.php';
|
|
require_once APP_ROOT . '/src/SmtpRelay.php';
|
|
$db = new Database();
|
|
$siteSettings = $db->getAllSettings();
|
|
$stats = $db->getThesesStats();
|
|
$smtpSettings = SmtpRelay::getSettings($db);
|
|
$smtpConfigured = SmtpRelay::isConfigured($db);
|
|
|
|
if (empty($_SESSION['csrf_token'])) {
|
|
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
|
}
|
|
|
|
$isAdmin = true; $bodyClass = 'admin-body';
|
|
require_once APP_ROOT . '/templates/head.php';
|
|
include APP_ROOT . '/templates/header.php';
|
|
include APP_ROOT . '/templates/admin/parametres.php';
|
|
require_once APP_ROOT . '/templates/admin/footer.php';
|