73 lines
2.8 KiB
PHP
73 lines
2.8 KiB
PHP
<?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>
|