����JFIF��`�`�����Viewing File: /home/u820193700/domains/throtllr.in/public_html/admin/login.php
<?php
require_once '../includes/db.php';
require_once '../includes/functions.php';

if (is_logged_in()) {
    redirect('index.php');
}

$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (!isset($_POST['csrf_token']) || !verify_csrf_token($_POST['csrf_token'])) {
        die("CSRF token validation failed.");
    }
    $username = sanitize($_POST['username']);
    $password = $_POST['password'];

    $stmt = $pdo->prepare("SELECT * FROM admin_users WHERE username = ?");
    $stmt->execute([$username]);
    $user = $stmt->fetch();

    if ($user && password_verify($password, $user['password'])) {
        session_regenerate_id(true);
        $_SESSION['admin_id'] = $user['id'];
        $_SESSION['admin_username'] = $user['username'];
        $_SESSION['admin_role'] = $user['role'];
        redirect('index.php');
    } else {
        $error = "Invalid username or password.";
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Admin Login - ReOwn</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { background-color: #1C1C1C; color: #F5F5F0; }
        .login-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 40px; }
    </style>
</head>
<body class="d-flex align-items-center justify-content-center vh-100">
    <div class="login-card col-md-4">
        <h2 class="text-center mb-4"><span class="text-danger">Re</span>Own Admin</h2>
        <?php if($error): ?><div class="alert alert-danger"><?php echo $error; ?></div><?php endif; ?>
        <form method="POST">
            <input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
            <div class="mb-3">
                <label>Username</label>
                <input type="text" name="username" class="form-control bg-dark text-white border-secondary" required value="admin">
            </div>
            <div class="mb-4">
                <label>Password</label>
                <input type="password" name="password" class="form-control bg-dark text-white border-secondary" required value="password">
                <small class="text-muted">Default login is admin/password</small>
            </div>
            <button type="submit" class="btn btn-danger w-100">Login</button>
            <div class="mt-3 text-center">
                <a href="../index.php" class="text-muted text-decoration-none"><i class="fas fa-arrow-left"></i> Back to Website</a>
            </div>
        </form>
    </div>
</body>
</html>
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����