Welcome Guest, Not a member yet? Register   Sign In
How to avoid this looping when try to reach index() ....
#1

[eluser]ReyPM[/eluser]
Hi every, I'm try to check if $this->current_user is set otherwise redirect to the login page but because Wall is my default route it loops and give me a 500 Internal Server Error, does any have some ideas in how to work with that? I'm using PyroCMS and them use IonAuth.

Code:
class Wall extends Public_Controller {

   public function __construct() {
parent::__construct();

if (empty($this->current_user)) {
     $this->session->set_flashdata('error', 'Debes iniciar sesión para acceder a esta página');
     redirect(site_url());
}
    }

}

Cheers and thanks in advance
#2

[eluser]CroNiX[/eluser]
You might try the PyroCMS forum.
https://www.pyrocms.com/forums
#3

[eluser]Aken[/eluser]
Do you understand the problem? You're checking for a valid user, and upon failure, sending them back to the same page.

Easy solution is send them to a different page (usually a login page).




Theme © iAndrew 2016 - Forum software by © MyBB