Hello,
I need that when I load the system I verify a session "paid" if it exists and its value is greater than zero, so that the system continues normal, but if the system does not exist or is zero, then it automatically redirects a controller and a method to force the user to assign the session "paid".
if ($this->CI->session->userdata('rolid')) {
// echo $this->perms[$this->role_field][$class][$method]; exit();
if (!isset($this->perms[$this->CI->session->userdata('rolid')][$class][$method])){
// echo 'entre aqui'; exit();
show_error(406);
}else if ($this->perms[$this->CI->session->userdata('rolid')][$class][$method]) {
if(!$this->CI->session->userdata('paid')){
redirect('admin/index','location');
}
return true;
// redirect('welcome','location');
} else {
show_error(403);
}
} else {
// print_r($class).'<br>'.print_r($method); exit();
if(strtolower($class) == 'login' || strtolower($class) == 'admin'){
return;
}
redirect('login','location');
}
That code is part of an ACL in a hook post_controller_construtor where I try to redirect with redirect('admin/index', 'location'); but the browser gets me an error, of "too many requests".
Any help or advice would be appreciated.