// Login de emergencia RHWA: versión simple y compatible. ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); try { require_once __DIR__ . '/config/db.php'; if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } if (!empty($_SESSION['user'])) { header('Location: index.php'); exit; } $error = null; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = trim($_POST['email'] ?? ''); $password = $_POST['password'] ?? ''; $stmt = db()->prepare('SELECT * FROM usuarios WHERE email = ? AND activo = 1 LIMIT 1'); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password_hash'])) { $_SESSION['user'] = [ 'id' => $user['id'], 'nombre' => $user['nombre'], 'email' => $user['email'], 'rol' => $user['rol'], ]; try { db()->prepare('UPDATE usuarios SET ultimo_login = NOW() WHERE id = ?')->execute([$user['id']]); } catch (Throwable $e) { // No bloquea el acceso si falta la columna; reparar_rhwa.php la agrega. } header('Location: index.php'); exit; } $error = 'Correo o contraseña incorrectos.'; } } catch (Throwable $e) { http_response_code(500); echo "

Error real en login.php

"; echo "

Mensaje: " . htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8') . "

"; echo "

Archivo: " . htmlspecialchars($e->getFile(), ENT_QUOTES, 'UTF-8') . "

"; echo "

Línea: " . (int)$e->getLine() . "

"; exit; } function e($v) { return htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8'); } ?> Entrar | Bot Reclutamiento

Bot Reclutamiento

Administrador de árboles, candidatos y conversaciones.

Usuario inicial: admin@bot.local
Contraseña: Admin123*