<?php require_once __DIR__.'/includes/auth.php'; $error=''; if($_SERVER['REQUEST_METHOD']==='POST'){ if(login_user($_POST['email']??'',$_POST['password']??'')) redirect_dashboard(current_user()['role']); $error='Invalid login details'; } require __DIR__.'/includes/header.php'; ?>
<div class="card"><h1>Login</h1><?php if($error): ?><p class="wrong"><?= $error ?></p><?php endif; ?><form method="post"><label>Email</label><input name="email" type="email" required><label>Password</label><input name="password" type="password" required><button>Login</button></form><p class="small">Default admin after import: admin@faithornstag.local / ChangeMe123!</p></div>
<?php require __DIR__.'/includes/footer.php'; ?>
