LuminaWebsite/login.php
Maaxxs 6dd68a6264 Remove email from user accounts entirely
Guild members only need a username/password, and nothing in the app
used email for anything (no notifications, no password reset). Drops
the column from the schema, the login lookup, install.php, and the
admin user list/form.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 06:37:04 +02:00

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 pruefen.';
}
}
$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'; ?>