<?php
require __DIR__ . '/../vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
$dotenv->safeLoad();
use App\Database;
$pdo = Database::getConnection();
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = :u LIMIT 1');
$stmt->execute([':u' => 'admin']);
$u = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$u) { echo "Admin user not found\n"; exit(1); }
$ok = password_verify('password', $u['password_hash'] ?? $u['password']);
echo 'Admin user found: username=' . ($u['username'] ?? '') . ' status=' . ($u['status'] ?? '') . "\n";
echo 'Password verify: ' . ($ok ? 'OK' : 'FAIL') . "\n";
