hrefs still * point at system.php?tab=… so navigation degrades gracefully. * * Response: text/html fragment (no /
/ wrapper). * On any auth failure or bad request: 403 / 400 with a plain-text body. */ require_once __DIR__ . "/../../bootstrap.php"; require_once __DIR__ . '/../../src/AdminAuth.php'; require_once APP_ROOT . '/src/Database.php'; require_once APP_ROOT . '/src/SystemCache.php'; require_once APP_ROOT . '/src/Controllers/SystemController.php'; if (!AdminAuth::isAuthenticated()) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo 'Non autorisé'; exit; } // ── Validate inputs ──────────────────────────────────────────────────────── $tab = $_GET['tab'] ?? 'nginx_access'; if ($tab !== 'nginx_config' && !array_key_exists($tab, SystemController::LOG_FILES)) { $tab = 'nginx_access'; } $n = isset($_GET['n']) ? (int) $_GET['n'] : 100; if (!in_array($n, SystemController::ALLOWED_LINES, true)) { $n = 100; } header('Content-Type: text/html; charset=utf-8'); header('X-Robots-Tag: noindex'); // ── Build data via controller ────────────────────────────────────────────── $_db = new Database(); $_cache = new SystemCache($_db->getPDO()); $_controller = new SystemController($_db, $_cache); // ── Render ───────────────────────────────────────────────────────────────── if ($tab === 'nginx_config') { $data = $_controller->getNginxConfigData(); $lines = $data['lines']; $source = $data['source']; $meta = $data['meta']; $error = $data['error']; if ($meta): ?>/etc/nginx/sites-available/posterg n'existe pas.
La config de référence se trouve dans nginx/posterg.conf.