isAuthenticated()) { $currentUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : []; $accountCheck = $accountGate->checkUsername((string) ($currentUser['username'] ?? '')); if (!($accountCheck['allowed'] ?? false)) { $auth->logout(); $target = (string) ($accountCheck['state'] ?? '') === 'pending' ? '/auth/pending/?username=' . urlencode((string) ($currentUser['username'] ?? '')) : '/auth/inactive/?message=' . urlencode((string) ($accountCheck['message'] ?? 'Dieses Konto ist noch nicht freigeschaltet.')); header('Location: ' . $target, true, 302); exit; } } if (!$auth->shouldShowDesktop()) { header('Location: /auth/keycloak', true, 302); exit; } $assetVersion = static function (string $publicPath) use ($projectRoot): string { $filesystemPath = $projectRoot . '/public' . $publicPath; if (!is_file($filesystemPath)) { return $publicPath; } $mtime = filemtime($filesystemPath); return $mtime === false ? $publicPath : $publicPath . '?v=' . $mtime; }; $sections = [ ['key' => 'overview', 'label' => 'Übersicht'], ['key' => 'upload', 'label' => 'Upload'], ['key' => 'measurements', 'label' => 'Mining-History'], ['key' => 'wallet', 'label' => 'Wallet'], ['key' => 'mining', 'label' => 'Miner-Daten'], ['key' => 'dashboards', 'label' => 'Dashboards'], ]; $defaultProjectKey = getenv('MINING_CHECKER_DEFAULT_PROJECT_KEY') ?: 'doge-main'; $activeView = trim((string) ($_GET['view'] ?? 'overview')); $sectionKeys = array_values(array_filter(array_map( static fn (mixed $section): string => is_array($section) ? trim((string) ($section['key'] ?? '')) : '', $sections ))); if ($sectionKeys === []) { $sectionKeys = ['overview']; } if (!in_array($activeView, $sectionKeys, true)) { $activeView = $sectionKeys[0]; } $sectionsJson = json_encode($sections, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?> Mining-Checker