| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/arni-solutions.de/web/slot/ |
Upload File : |
<?php
require_once __DIR__ . '/includes/bootstrap.php';
$config = app_config();
$error = '';
if (current_user()) {
header('Location: index.php');
exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim((string)($_POST['username'] ?? ''));
$password = (string)($_POST['password'] ?? '');
if ($username === '' || $password === '') {
$error = 'Bitte Nutzername und Passwort angeben.';
} else {
$stmt = db()->prepare('SELECT * FROM users WHERE username = ? LIMIT 1');
$stmt->execute([$username]);
$user = $stmt->fetch();
if (!$user || !password_verify($password, $user['password_hash'])) {
$error = 'Login fehlgeschlagen.';
} else {
login_user($user);
header('Location: index.php');
exit;
}
}
}
?>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title><?= e($config['app']['name']) ?> Login</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/style.css" rel="stylesheet">
</head>
<body class="auth-body">
<div class="container py-4 py-md-5">
<div class="row justify-content-center g-3">
<div class="col-12 col-lg-5">
<div class="card slot-card auth-card">
<div class="card-body p-4">
<h1 class="display-6 text-center mb-3">🎰 <?= e($config['app']['name']) ?></h1>
<p class="text-center text-soft mb-4">Login oder registrieren und direkt losdrehen.</p>
<?php if ($error): ?><div class="alert alert-danger"><?= e($error) ?></div><?php endif; ?>
<form method="post" class="vstack gap-3">
<div>
<label class="form-label">Nutzername</label>
<input type="text" name="username" class="form-control form-control-lg" required>
</div>
<div>
<label class="form-label">Passwort</label>
<input type="password" name="password" class="form-control form-control-lg" required>
</div>
<button class="btn btn-warning btn-lg w-100">Einloggen</button>
</form>
<div class="text-center mt-4 d-grid gap-2">
<a href="register.php" class="link-light">Noch kein Account? Registrieren</a>
<a href="highscores.php" class="btn btn-outline-light">Bestenliste ansehen</a>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>