Results 1 to 8 of 8

Thread: How do we redirect user after login?

  1. #1
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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?
    If it's not fun, stop doing it!

  2. #2
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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?
    If it's not fun, stop doing it!

  3. #3
    Join Date
    May 2008
    Posts
    4

    Default 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 :)

  4. #4
    Join Date
    Sep 2008
    Posts
    1,019

    Default 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.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  5. #5

    Default 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

  6. #6
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: How do we redirect user after login?

    I assume that code is located on login.php.....
    If it's not fun, stop doing it!

  7. #7

    Default 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

  8. #8
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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...
    If it's not fun, stop doing it!

Similar Threads

  1. Admin redirect
    By alan081954 in forum Installation Support
    Replies: 8
    Last Post: 09-09-2008, 11:48 PM
  2. Process Bar and redirect
    By one11 in forum Installation Support
    Replies: 5
    Last Post: 08-28-2008, 07:28 PM
  3. Redirect User after Login
    By grynmoors in forum Feature Requests
    Replies: 0
    Last Post: 03-14-2008, 01:44 AM
  4. vShare requires user signup/login, other questions
    By sleat in forum Sales Questions
    Replies: 1
    Last Post: 10-15-2007, 09:53 AM
  5. no more user login
    By nocomp in forum Fixed Bugs
    Replies: 2
    Last Post: 10-04-2007, 04:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •