How do we redirect user after login?
I started a post on this previously, but haven't gotten a solution that works, so I was wondering if anybody else might know. See viewtopic.php?f=12&t=1624&p=7239
I want people to go to the last page they were at after they login...I don't want them taken to their profile page. Every time you login, it takes you to your profile page and when that happens, the "views" total goes up. I want people to be taken to the last page they viewed before they logged in.
Anybody know how to do this without the polls feature getting broken?
Re: How do we redirect user after login?
OK, this is an old thread but I'm asking this once again since the code has changed with 2.6....I want to redirect users to the welcome page after they login. It's that same page you first get after you click the link in the email to verify your account and then sign in...where it says "what would you like to do?"
I tried to change the login action to login.php?next={$baseurl}/invite_friends.php but it still goes to the profile page. I don't know how else to change it, anybody know?
Re: How do we redirect user after login?
Quote:
Originally Posted by grynmoors
OK, this is an old thread but I'm asking this once again since the code has changed with 2.6....I want to redirect users to the welcome page after they login. It's that same page you first get after you click the link in the email to verify your account and then sign in...where it says "what would you like to do?"
I tried to change the login action to login.php?next={$baseurl}/invite_friends.php but it still goes to the profile page. I don't know how else to change it, anybody know?
I`m also looking for this option but it seems no one its alive here :)
Re: How do we redirect user after login?
This isn't possible because the location path (sending users to the profile) is hard coded in version 2.6. To change this would require a rewrite of the login.php file. It would be pointless to rewrite this as the next version will be out tomorrow. All that would have to be done is a quick change of the code.
Re: How do we redirect user after login?
Change :
Code:
if ( isset( $_SESSION['REDIRECT'] ) && $_SESSION['REDIRECT'] != "" )
{
$redirect_url = $_SESSION['REDIRECT'];
$_SESSION['REDIRECT'] = "";
}
else
{
$redirect_url = $config['baseurl']."/".$user_info['username'];
}
redirect( $redirect_url );
to:
Code:
$next = $_GET['next'];
if ($next == ""){
if ( isset( $_SESSION['REDIRECT'] ) && $_SESSION['REDIRECT'] != "" )
{
$redirect_url = $_SESSION['REDIRECT'];
$_SESSION['REDIRECT'] = "";
}
else
{
$redirect_url = $config['baseurl']."/".$user_info['username'];
}
redirect( $redirect_url );
}else{
redirect( $next );
}
Now just make links like this:
http://site.com/login?{$baseurl}/whatever
Re: How do we redirect user after login?
I assume that code is located on login.php.....
Re: How do we redirect user after login?
Quote:
Originally Posted by grynmoors
I assume that code is located on login.php.....
Yes. Version 2.6
Use dezender to decrypt it
Re: How do we redirect user after login?
Not everyone has dezender.
Fortunately, this is no longer a problem with 2.7 :)
For the "links"...where do I put that?
I think it's just easier to change the part that does the redirect (around line 133 in index.php vshare v2.7)
Find
Code:
$redirect_url = $config['baseurl'] . '/' . $user_info['user_name'];
Replace with
Code:
$redirect_url = $config['baseurl'] . '/' ;
Which will take them to the index.php page after login...