<?php
// login_test_direct.php - teste rápido. Remova após usar.
require_once __DIR__ . '/auth.php';
header('Content-Type: text/plain; charset=utf-8');

echo "session_id: " . session_id() . "\n";
$u = verify_user('admin', 'admin');
if ($u === false) {
    echo "verify_user: false\n";
} elseif ($u === 'blocked') {
    echo "verify_user: blocked\n";
} else {
    echo "verify_user: OK - id=" . ($u['id'] ?? '-') . " username=" . ($u['username'] ?? '-') . " role=" . ($u['role'] ?? '-') . "\n";
    login_user($u);
    echo "Depois de login_user(), \$_SESSION['user']: " . print_r($_SESSION['user'], true) . "\n";
}