CodeIgniter Forums
Problem with redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Problem with redirect (/thread-43490.html)



Problem with redirect - El Forum - 07-13-2011

[eluser]Wonder Woman[/eluser]
Hello,

Can anyone help me with my redirect problem?

I want it to go to http://example.com/admin/ if they are not the correct admin level but instead it goes to to http://example.com no matter how much I have tried to make it redirect to the admin section.

This is the code in my controller:

Code:
// check to see if the user is logged in
if (!$this->tank_auth->is_logged_in()) {
   redirect('admin/login/');
}
else {
   // check to see if they are an administrator
   if($this->admin_model->get_admin_level($this->tank_auth->get_user_id()) != 1) {
      redirect('admin/dashboard/');
   }
}

Thanks


Problem with redirect - El Forum - 07-13-2011

[eluser]Wonder Woman[/eluser]
Forgive me, I have utterly blonde and this is sorted! Thanks