login change

This commit is contained in:
2025-11-22 01:44:03 +01:00
parent a5ce6a079a
commit b3a3d25502
9 changed files with 474 additions and 35 deletions

View File

@@ -1,6 +1,19 @@
<?php
// Fallback falls $authView nicht gesetzt ist
$authView = $authView ?? 'login';
// Optional: View über GET-Parameter überschreiben (?view=login|register)
if (isset($_GET['view']) && in_array($_GET['view'], ['login', 'register'], true)) {
$authView = $_GET['view'];
}
// Flash-Meldung holen (falls flash_get() existiert)
$flash = function_exists('flash_get') ? flash_get() : null;
// Wenn eine Flash-Message mit Kontext kommt, Tabs entsprechend umschalten
if ($flash && !empty($flash['context']) && in_array($flash['context'], ['login', 'register'], true)) {
$authView = $flash['context'];
}
?>
<section id="auth" class="border-t border-brand-border/70 bg-brand-primarySoft/20">
<div class="mx-auto max-w-xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20">
@@ -16,6 +29,20 @@ $authView = $authView ?? 'login';
</p>
</div>
<?php if ($flash): ?>
<div class="mb-6 rounded-xl px-4 py-3 text-sm border
<?php if ($flash['type'] === 'error'): ?>
border-red-500/60 bg-red-500/10 text-red-300
<?php elseif ($flash['type'] === 'success'): ?>
border-emerald-500/60 bg-emerald-500/10 text-emerald-300
<?php else: ?>
border-brand-border bg-brand-bg/60 text-brand-muted
<?php endif; ?>
">
<?= htmlspecialchars($flash['message']) ?>
</div>
<?php endif; ?>
<!-- Tabs -->
<div class="mb-6 rounded-full border border-brand-border bg-brand-surface/80 p-1 flex text-xs font-semibold uppercase tracking-[0.18em] text-brand-muted">
<button
@@ -47,8 +74,10 @@ $authView = $authView ?? 'login';
Melde dich mit deiner E-Mail-Adresse und deinem Passwort an.
</p>
<form method="post" action="/login/?lang=<?= htmlspecialchars($lang) ?>" class="space-y-4" autocomplete="on">
<input type="hidden" name="action" value="login">
<form method="post" action="/auth/login" class="space-y-4" autocomplete="on">
<input type="hidden" name="lang" value="<?= htmlspecialchars($lang ?? 'de') ?>">
<input type="hidden" name="redirect" value="<?= htmlspecialchars($_GET['redirect'] ?? '/') ?>">
<input type="hidden" name="authView" value="login">
<div class="space-y-1">
<label for="login_email" class="block text-xs font-semibold tracking-wide uppercase text-brand-muted" data-i18n="auth_login_email_label">
@@ -108,8 +137,10 @@ $authView = $authView ?? 'login';
Erstelle einen kostenlosen Account, um Tests zu speichern, Berichte zu exportieren und den Pro-Modus später freizuschalten.
</p>
<form method="post" action="/login/?lang=<?= htmlspecialchars($lang) ?>" class="space-y-4" autocomplete="on">
<input type="hidden" name="action" value="register">
<form method="post" action="/auth/register" class="space-y-4" autocomplete="on">
<input type="hidden" name="lang" value="<?= htmlspecialchars($lang ?? 'de') ?>">
<input type="hidden" name="redirect" value="<?= htmlspecialchars($_GET['redirect'] ?? '/') ?>">
<input type="hidden" name="authView" value="register">
<div class="space-y-1">
<label for="reg_name" class="block text-xs font-semibold tracking-wide uppercase text-brand-muted" data-i18n="auth_register_name_label">