Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 21, 2021 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/45fceaee911b6923b5a758eeb5f40367 to your computer and use it in GitHub Desktop.
Save parzibyte/45fceaee911b6923b5a758eeb5f40367 to your computer and use it in GitHub Desktop.
<?php
include_once "encabezado.php";
include_once "funciones.php";
# Si no hay usuario logueado, salir inmediatamente
if (!usuarioEstaLogueado()) {
header("Location: formulario_login.php?mensaje=Inicia sesión para acceder a la página protegida");
exit; // <- Es muy importante terminar el script
}
# Si llegamos aquí, es que el usuario inició sesión anteriormente
$usuarios = obtenerUsuariosConIntentosFallidos();
?>
<div class="col-12">
<h1>Usuarios</h1>
<table class="table">
<thead>
<tr>
<th>Correo</th>
<th>Intentos fallidos</th>
<th>Reiniciar</th>
</tr>
</thead>
<tbody>
<?php foreach ($usuarios as $usuario) { ?>
<tr>
<td><?php echo $usuario->correo ?></td>
<td><?php echo $usuario->intentos_fallidos ?></td>
<td>
<a href="reiniciar_conteo.php?id=<?php echo $usuario->id ?>" class="btn btn-danger">Reiniciar</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php ?>
</div>
<?php include_once "pie.php"; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment