adasdas
All checks were successful
Deploy / deploy-staging (push) Successful in 24s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-15 23:19:24 +02:00
parent 033fdfd598
commit 2c3c84e66f
8 changed files with 164 additions and 8 deletions

View File

@@ -57,9 +57,11 @@ if ($state === '' || $expectedState === '' || !hash_equals($expectedState, $stat
if (!($accountCheck['allowed'] ?? false)) {
$auth->logout();
http_response_code(403);
$title = 'Zugriff gesperrt';
$message = (string) ($accountCheck['message'] ?? 'Dieses Konto ist noch nicht freigeschaltet.');
$target = (string) ($accountCheck['state'] ?? '') === 'pending'
? '/auth/pending/?username=' . urlencode($username)
: '/auth/inactive/?message=' . urlencode((string) ($accountCheck['message'] ?? 'Dieses Konto ist noch nicht freigeschaltet.'));
header('Location: ' . $target, true, 302);
exit;
} else {
$auth->establishSession($tokenPayload, $userPayload);
header('Location: ' . $redirectTarget, true, 302);

View File

@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__, 3) . '/src/App/bootstrap.php';
use App\ConfigLoader;
use App\RegistrationService;
$projectRoot = dirname(__DIR__, 3);
$registration = new RegistrationService($projectRoot, ConfigLoader::load($projectRoot, 'registration'));
$username = strtolower(trim((string) ($_GET['username'] ?? '')));
$request = $registration->findLatestByUsername($username);
$status = (string) ($request['status'] ?? 'pending_approval');
$statusMap = [
'pending_approval' => [
'title' => 'Freigabe ausstehend',
'copy' => 'Dein Konto wurde angelegt und wartet aktuell auf die manuelle Freigabe.',
'label' => 'Wartet auf Freigabe',
],
'provisioning_failed' => [
'title' => 'Bearbeitung erforderlich',
'copy' => 'Dein Konto konnte technisch noch nicht vollständig vorbereitet werden. Die Anfrage liegt bereits vor und wird geprüft.',
'label' => 'Technische Prüfung läuft',
],
'approved_active' => [
'title' => 'Freigeschaltet',
'copy' => 'Dein Konto wurde bereits freigeschaltet. Bitte melde dich erneut an.',
'label' => 'Freigeschaltet',
],
];
$view = $statusMap[$status] ?? [
'title' => 'Freigabestatus',
'copy' => 'Der Status deiner Freigabe wird aktuell verarbeitet.',
'label' => 'In Bearbeitung',
];
?><!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($view['title'], ENT_QUOTES) ?></title>
<link rel="stylesheet" href="/assets/auth/login.css">
</head>
<body>
<main class="login-shell">
<section class="login-panel">
<div class="login-panel-top">
<p class="login-kicker">Kusche.Berlin</p>
<h1><?= htmlspecialchars($view['title'], ENT_QUOTES) ?></h1>
<p class="login-copy"><?= htmlspecialchars($view['copy'], ENT_QUOTES) ?></p>
</div>
<div class="login-notice login-notice-info">
<strong>Aktueller Stand</strong>
<p>Status: <?= htmlspecialchars($view['label'], ENT_QUOTES) ?></p>
<?php if (is_array($request)): ?>
<p>Benutzername: <?= htmlspecialchars((string) ($request['username'] ?? ''), ENT_QUOTES) ?></p>
<p>E-Mail: <?= htmlspecialchars((string) ($request['email'] ?? ''), ENT_QUOTES) ?></p>
<p class="login-meta-inline">Vorgangs-ID: <?= htmlspecialchars((string) ($request['id'] ?? ''), ENT_QUOTES) ?></p>
<?php endif; ?>
</div>
<div class="login-actions">
<a class="login-button login-button-primary" href="/auth/keycloak">Zum Login</a>
</div>
</section>
</main>
</body>
</html>