layout
This commit is contained in:
48
public/auth/register/confirmation/index.php
Normal file
48
public/auth/register/confirmation/index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
session_start();
|
||||
|
||||
$confirmation = is_array($_SESSION['registration_confirmation'] ?? null)
|
||||
? $_SESSION['registration_confirmation']
|
||||
: null;
|
||||
|
||||
if ($confirmation === null) {
|
||||
header('Location: /auth/register/', true, 302);
|
||||
exit;
|
||||
}
|
||||
|
||||
unset($_SESSION['registration_confirmation']);
|
||||
?><!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Registrierung bestätigt</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>Registrierung eingegangen</h1>
|
||||
<p class="login-copy">Deine Registrierung wurde erfolgreich gespeichert und als inaktiver Benutzer vorbereitet. Eine berechtigte Person prüft jetzt die Freischaltung.</p>
|
||||
</div>
|
||||
|
||||
<div class="login-notice login-notice-success">
|
||||
<strong>Bestätigung</strong>
|
||||
<p>Benutzername: <?= htmlspecialchars((string) ($confirmation['username'] ?? ''), ENT_QUOTES) ?></p>
|
||||
<p>E-Mail: <?= htmlspecialchars((string) ($confirmation['email'] ?? ''), ENT_QUOTES) ?></p>
|
||||
<p class="login-meta-inline">Vorgangs-ID: <?= htmlspecialchars((string) ($confirmation['id'] ?? ''), ENT_QUOTES) ?></p>
|
||||
</div>
|
||||
|
||||
<div class="login-actions">
|
||||
<a class="login-button login-button-primary" href="/auth/keycloak">Weiter zu Keycloak</a>
|
||||
<a class="login-button login-button-secondary" href="/auth/register/">Neue Registrierung</a>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,8 +26,6 @@ if ($csrfToken === '') {
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
$submitted = false;
|
||||
$createdRequest = null;
|
||||
$form = [
|
||||
'username' => '',
|
||||
'given_name' => '',
|
||||
@@ -57,18 +55,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (($result['success'] ?? false) !== true) {
|
||||
$errors = array_values(array_map('strval', (array) ($result['errors'] ?? [])));
|
||||
} else {
|
||||
$submitted = true;
|
||||
$createdRequest = $result['request'] ?? null;
|
||||
$createdRequest = is_array($result['request'] ?? null) ? $result['request'] : [];
|
||||
$_SESSION['registration_confirmation'] = [
|
||||
'id' => (string) ($createdRequest['id'] ?? ''),
|
||||
'username' => (string) ($createdRequest['username'] ?? ''),
|
||||
'email' => (string) ($createdRequest['email'] ?? ''),
|
||||
];
|
||||
$csrfToken = bin2hex(random_bytes(16));
|
||||
$_SESSION['registration_form_token'] = $csrfToken;
|
||||
$form = [
|
||||
'username' => '',
|
||||
'given_name' => '',
|
||||
'family_name' => '',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
'password_confirm' => '',
|
||||
];
|
||||
header('Location: /auth/register/confirmation/', true, 302);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,16 +85,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<p class="login-copy">Neue Konten werden nicht sofort freigeschaltet. Deine Anfrage wird geprüft und erst danach für LDAP, NAS und Desktop vorbereitet.</p>
|
||||
</div>
|
||||
|
||||
<?php if ($submitted): ?>
|
||||
<div class="login-notice login-notice-success">
|
||||
<strong>Anfrage gespeichert.</strong>
|
||||
<p>Dein Zugang wurde noch nicht freigeschaltet. Eine berechtigte Person prüft nun die Registrierung.</p>
|
||||
<?php if (is_array($createdRequest)): ?>
|
||||
<p class="login-meta-inline">Vorgangs-ID: <?= htmlspecialchars((string) ($createdRequest['id'] ?? ''), ENT_QUOTES) ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($errors !== []): ?>
|
||||
<div class="login-notice login-notice-error">
|
||||
<strong>Bitte prüfen</strong>
|
||||
@@ -110,7 +96,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="login-form" method="post" action="/auth/register">
|
||||
<form class="login-form" method="post" action="/auth/register/">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrfToken, ENT_QUOTES) ?>">
|
||||
|
||||
<div class="login-form-grid">
|
||||
|
||||
Reference in New Issue
Block a user