Startseite: Anfrageformular sendet serverseitig, Landingpage und netcup-Ziel
- Neues oeffentliches Formular-Endpoint POST /anfrage (app/inquiry.php): Pflichtfelder ausser Nachricht, Validierung, Honeypot, IP-Limit 5/Stunde, Versand per mail_send() mit Reply-To des Kunden - kein mailto mehr - mail_send() akzeptiert zusaetzliche Kopfzeilen (CRLF bereinigt) - app.inquiry_email in Konfiguration und Deploy-Template (DIC_INQUIRY_EMAIL) - Statische Landingpage web/index.html mit Assets, Service-Worker-Cache dic-v18 - App-Routen auf /dashboard, netcup-Deploy-Doku und Fundstellen aktualisiert
This commit is contained in:
parent
273eabfdb7
commit
fe388838db
27 changed files with 2598 additions and 57 deletions
|
|
@ -62,6 +62,10 @@ function page_handle(string $method, string $path): void
|
|||
legal_page(substr($path, 1));
|
||||
return;
|
||||
}
|
||||
if ($path === '/anfrage') {
|
||||
page_inquiry($method);
|
||||
return;
|
||||
}
|
||||
|
||||
$user = auth_user();
|
||||
if ($user !== null && $user['must_change_password'] === 1
|
||||
|
|
@ -79,7 +83,7 @@ function page_handle(string $method, string $path): void
|
|||
|
||||
$user = auth_require_login();
|
||||
|
||||
if ($path === '/') {
|
||||
if ($path === '/' || $path === '/dashboard') {
|
||||
page_dashboard($user);
|
||||
return;
|
||||
}
|
||||
|
|
@ -239,7 +243,7 @@ function page_login(string $method): void
|
|||
// anderen Zugangsdaten im selben Browser stillschweigend verpuffen und
|
||||
// man bliebe im alten Konto.
|
||||
if ($method !== 'POST' && auth_user() !== null) {
|
||||
redirect('/');
|
||||
redirect('/dashboard');
|
||||
}
|
||||
$error = '';
|
||||
$first = '';
|
||||
|
|
@ -251,7 +255,7 @@ function page_login(string $method): void
|
|||
$last = post_string('last_name');
|
||||
$password = (string) ($_POST['password'] ?? '');
|
||||
$remember = post_string('remember') === '1';
|
||||
$next = safe_next(post_string('next'), '/');
|
||||
$next = safe_next(post_string('next'), '/dashboard');
|
||||
|
||||
if (!csrf_valid()) {
|
||||
$error = 'Die Sitzung ist abgelaufen. Bitte erneut versuchen.';
|
||||
|
|
@ -281,7 +285,7 @@ function page_login(string $method): void
|
|||
'first' => $first,
|
||||
'last' => $last,
|
||||
'remember' => $remember,
|
||||
'next' => safe_next(query_string('next') ?: post_string('next'), '/'),
|
||||
'next' => safe_next(query_string('next') ?: post_string('next'), '/dashboard'),
|
||||
], 'Anmelden');
|
||||
}
|
||||
|
||||
|
|
@ -1306,7 +1310,7 @@ function page_account(array $user, string $method): void
|
|||
$_SESSION['epoch'] = $newEpoch;
|
||||
$_SESSION['csrf'] = bin2hex(random_bytes(32));
|
||||
flash('success', 'Das Passwort wurde geändert. Andere Geräte müssen sich neu anmelden.');
|
||||
redirect('/');
|
||||
redirect('/dashboard');
|
||||
} catch (Throwable $error) {
|
||||
$pdo->rollBack();
|
||||
throw $error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue