getAllSettings(); $peerTubeSettings = PeerTubeService::getSettings($db); $peerTubeEnabled = PeerTubeService::isEnabled($db); $peerTubeConfigured = PeerTubeService::isConfigured($db); $smtpSettings = SmtpRelay::getSettings($db); $smtpConfigured = SmtpRelay::isConfigured($db); $smtpErrorField = $_SESSION['_flash_smtp_field'] ?? null; unset($_SESSION['_flash_smtp_field']); // ── System section ──────────────────────────────────────────────────────────── require_once APP_ROOT . '/src/SystemCache.php'; require_once APP_ROOT . '/src/Controllers/SystemController.php'; $_db2 = new Database(); $_cache = new SystemCache($_db2->getPDO()); $_controller = new SystemController($_db2, $_cache); if (isset($_GET['refresh']) && $_GET['refresh'] === '1') { $_controller->invalidateAll(); } $statusData = $_controller->getStatusData(); $checks = $statusData['checks']; $statusCached = $statusData['cached']; $statusCacheAge = $statusData['cacheAge']; $phpInfo = $_controller->getPhpInfo(); $diskInfo = $_controller->getDiskInfo(); $diskTotal = $diskInfo['total']; $diskFree = $diskInfo['free']; $diskUsed = $diskInfo['used']; $diskPct = $diskInfo['pct']; $diskColor = SystemController::diskColor($diskPct); // ── Logs section ────────────────────────────────────────────────────────────── $activeTab = $_GET['tab'] ?? 'app'; if ($activeTab === 'status' || !array_key_exists($activeTab, SystemController::LOG_FILES)) { $activeTab = 'app'; } $selectedN = isset($_GET['n']) ? (int) $_GET['n'] : 100; if (!in_array($selectedN, SystemController::ALLOWED_LINES, true)) { $selectedN = 100; } $logData = $_controller->getLogData($activeTab, $selectedN); $logLines = $logData['lines']; $logError = $logData['error']; $logFileMeta = $logData['meta']; $logIsJson = $logData['isJson'] ?? false; $notYet = $logData['notYet'] ?? false; $collapsed = $_COOKIE['sys_collapsed'] ?? null; $statusInitiallyCollapsed = $collapsed === '1'; // ── Page setup ──────────────────────────────────────────────────────────────── if (empty($_SESSION['csrf_token'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); } $isAdmin = true; $bodyClass = 'admin-body'; $extraCssAdmin = ['/assets/css/system.css']; 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';