[eluser]ericsodt[/eluser]
So I am doing some filtering at the controller level. I am making sure that a regular user stays within the regular user section and the admins stay within the admin section.
To do this, I extended the Controller and built some logic around it
Code:
function validate(){
$inAdminSection = $this->uri->segment(1) == 'admin'?true:false;
if(!$this->session->userdata("isAdmin")&& $inAdminSection ){
redirect('profile/adminLogin');
}
if($this->session->userdata("isAdmin") && !$inAdminSection && $loggingOut){
redirect('admin/admin/index');
}
return;
}
Everything works fine except when I try and log an admin out. It sees that it is not in the admin section and is an admin, which then throws them back to where they were.
I am just trying to pass any values to the Controller that would have been passed to the calling method. For example, to log out the url is "welcome/index". This checks to see if the user is logging out and if so completes this action. This method however will never get called because of My_Controller. I was thinking of passing a variable through it as so "welcome/index/logout" but I am having a hard time figuring out how My_Controller can see the parameter.
Does anyone know how a Controller can capture what is being passed to the desired method?
Thanks!