This commit is contained in:
Lizandro Guarnizo
2026-03-10 18:42:51 -05:00
parent b57fc16ab3
commit db469b2134
98 changed files with 16365 additions and 303 deletions
+7 -4
View File
@@ -53,15 +53,18 @@ if ($_POST && !$loginBlocked) {
$_SESSION['last_activity'] = time();
$_SESSION['login_ip'] = $clientIp;
$_SESSION['login_time'] = time();
header('Location: index.php');
// Redirigir según el rol
if (($adminUser['role'] ?? 'admin') === 'enfermero') {
header('Location: enfermero_portal.php');
} else {
header('Location: index.php');
}
exit;
} else {
// Login fallido
recordFailedLogin($clientIp);
$error = 'Usuario o contraseña incorrectos.';
// Verificar si se bloqueó después de este intento
if (!checkLoginAttempts($clientIp)) {
$loginBlocked = true;
$error = 'Demasiados intentos de login. Cuenta bloqueada por ' . (LOGIN_LOCKOUT_TIME / 60) . ' minutos.';