Every "oe/ae/ue" spelling throughout the UI text and comments (fuer, loeschen, koennen, ...) was my own typo, not an encoding bug - the charset fix in the last commit was unrelated. Replaced all of them with proper ö/ä/ü across every PHP file and the README. Also fix table rows rendering inconsistently: `.actions` and the status badges were applying `display:flex` directly to a <td>, which fights the table layout model and renders unreliably across browsers. Moved the flex layout into a wrapper <div> inside each cell instead, and restyled row-level delete buttons as plain text links so they match the height of the "Bearbeiten" link exactly. Tables also get a horizontal-scroll wrapper so narrow viewports scroll instead of squeezing cell content. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
|
|
if (current_user()) {
|
|
redirect('/dashboard.php');
|
|
}
|
|
|
|
$error = null;
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
verify_csrf();
|
|
|
|
$username = trim((string) ($_POST['username'] ?? ''));
|
|
$password = (string) ($_POST['password'] ?? '');
|
|
|
|
if ($username === '' || $password === '') {
|
|
$error = 'Bitte Benutzername und Passwort eingeben.';
|
|
} elseif (attempt_login($username, $password)) {
|
|
redirect('/dashboard.php');
|
|
} else {
|
|
$error = 'Login fehlgeschlagen. Bitte Zugangsdaten prüfen.';
|
|
}
|
|
}
|
|
|
|
$pageTitle = 'Login';
|
|
include __DIR__ . '/includes/header.php';
|
|
?>
|
|
<div class="panel panel-narrow">
|
|
<h1>Login</h1>
|
|
<?php if ($error): ?>
|
|
<div class="flash flash-error"><?= e($error) ?></div>
|
|
<?php endif; ?>
|
|
<form method="post" action="/login.php">
|
|
<?= csrf_field() ?>
|
|
<div>
|
|
<label for="username">Benutzername</label>
|
|
<input type="text" id="username" name="username" required autofocus value="<?= e($_POST['username'] ?? '') ?>">
|
|
</div>
|
|
<div>
|
|
<label for="password">Passwort</label>
|
|
<input type="password" id="password" name="password" required>
|
|
</div>
|
|
<button type="submit">Anmelden</button>
|
|
</form>
|
|
</div>
|
|
<?php include __DIR__ . '/includes/footer.php'; ?>
|