Moderators mark1million Posted October 29, 2010 Moderators Report Share Posted October 29, 2010 HI is there a way to redirect to the requested page if members are not logged in? For example, someone tries to reach a page that requires them to be logged in so they are firstly directed to the login page then after successfully logging in they are taken to their initial requested page. Quote Link to comment Share on other sites More sharing options...
Jon Posted October 30, 2010 Report Share Posted October 30, 2010 I Don't know if it would work but maybe an if statement: <?php /* Quick example of how to see if they're logged in or not Only show this login form if they're logged in */ if(Auth::LoggedIn() == false) { ?> <a href="http://www.domain.com/index.php/login"> Please Login To View This Page! <?php {$this->show('login_form.tpl'); } ?> </a> Was just a thought but probably won't work lol Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 30, 2010 Administrators Report Share Posted October 30, 2010 To redirect back to the index page you can use; header('Location: '.url('/')); You can redirect to a certain page by adding the module in the url command. For example if you want to redirect to the pilots list; header('Location: '.url('/pilots')); Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted October 30, 2010 Author Moderators Report Share Posted October 30, 2010 Is it possible to pass the initial requested page as a variable so once they logged it it would take them to that page? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.