Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 19, 2019 18:07
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/96ede831764ca34f5f54022ce57430bd to your computer and use it in GitHub Desktop.
Save parzibyte/96ede831764ca34f5f54022ce57430bd to your computer and use it in GitHub Desktop.
<?php
# Si no hay datos, es decir, el usuario no está logueado...
if (!$this->session->has_userdata("usuario")) {
# Poner un mensaje de inicio de sesión
$this->session->set_flashdata('mensaje', 'No puedes acceder al recurso hasta que <strong>inicies sesión</strong>');
# Y redireccionar al login
redirect("login");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment