Welcome Guest, Not a member yet? Register   Sign In
Hook from redirect to page
#1

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.
Reply


Messages In This Thread
Hook from redirect to page - by Wilmer - 08-25-2018, 05:33 AM
RE: Hook from redirect to page - by jreklund - 08-25-2018, 06:03 AM
RE: Hook from redirect to page - by Wilmer - 08-25-2018, 11:27 AM
RE: Hook from redirect to page - by jreklund - 08-26-2018, 05:33 AM
RE: Hook from redirect to page - by Wilmer - 08-27-2018, 03:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB