layout
This commit is contained in:
@@ -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