Problem with redirect and authlib passing data in uri |
[eluser]Robert M.[/eluser]
Hi @ all, i use the authlib from the wiki http://codeigniter.com/wiki/auth/ and want to do some routings but get some problems with that. I want to call my controller via http://mysite.com/index.php/test_control...dex/123456 in the test_controller i want to check with the authlib if a user is logged in or not? When not they get redirected to login page... otherway they get logged in to another controller... test_controller Code: function index(){ when im allready logged in as an Member i get redirected to the other_controller with the right uri segment... http://mysite.com/index.php/other_contro...dex/123456 but when im not logged in i get.. http://mysite.com/index.php/auth/login/123456 so here is everything ok but when i want to login i get redirected to the other_controller but without Code: $my_third_uri_segment i have in the auth.php from the authlib this function... Code: function login() and in the Authlib.php Code: function login() i think i must change something in this line in auth.php Code: redirect($this->config->item('auth_login_success_action'), 'location'); //On success redirect user to default page the auth_login_success_action is fixed in the authconfig.php but i want to redirect to the controller with the $my_third_uri_segment so i tried these... Code: redirect('other_controller/index/'.$my_third_uri_segment.'/', 'location'); now im get redirected but the $my_third_uri_segment is missed and i dont know how this is happend... can someone help me with that??? regards Robert
[eluser]Michael Wales[/eluser]
I'm trying to follow what you are attempting but it's kind of confusing (maybe you're making this harder than it needs to be?). Regardless, my first guess would be $my_third_uri_segment is not set in this line: Code: redirect('other_controller/index/'.$my_third_uri_segment.'/', 'location'); Change it to: Code: redirect('other_controller/index/'. $this->uri->segment(3) .'/', 'location'); and let's set what happens.
[eluser]Robert M.[/eluser]
thx for your help i will try it later im writing now my own authlib^^ |
Welcome Guest, Not a member yet? Register Sign In |