Validación correo y contraseña
This commit is contained in:
@@ -135,14 +135,17 @@ function validar()
|
||||
|
||||
} else {
|
||||
registrarBitacora($conn, $row['id_usuario'], $email, $ip, 0, 'Contraseña incorrecta');
|
||||
$_SESSION['login_error'] = '❌ Contraseña incorrecta, intenta nuevamente.';
|
||||
header('Location: /IMPORTADORES/login');
|
||||
exit;
|
||||
}
|
||||
|
||||
} else {
|
||||
registrarBitacora($conn, null, $email, $ip, 0, 'Usuario no encontrado');
|
||||
$_SESSION['login_error'] = '❌ Correo no encontrado, debe registrarse primero.';
|
||||
header('Location: /IMPORTADORES/login');
|
||||
exit;
|
||||
}
|
||||
|
||||
$_SESSION['login_error'] = 'Credenciales incorrectas.';
|
||||
header('Location: /IMPORTADORES/login');
|
||||
}
|
||||
|
||||
/** Función auxiliar para redirección por rol **/
|
||||
|
||||
@@ -72,6 +72,14 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
|
||||
color: #666;
|
||||
margin-top: 60px;
|
||||
}
|
||||
#mensaje {
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
@media (max-height: 600px) {
|
||||
footer {
|
||||
position: static !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -131,6 +139,14 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="mensaje" class="mt-3 text-center fw-bold">
|
||||
<?php if (isset($_SESSION['login_error'])): ?>
|
||||
<div class="text-danger"><?= $_SESSION['login_error'] ?></div>
|
||||
<?php unset($_SESSION['login_error']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
|
||||
Reference in New Issue
Block a user