Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorbjork24
    • CommentTimeJul 24th 2006 edited
     # 1
    I'm building a site and I'd like it to have one univeral sign-in that will allow the member access onto the forum (vanilla of course) and other features within the site. I noticed this snippet:

    $this->ReturnUrl = urldecode(ForceIncomingString('ReturnUrl', ''));
    if ($this->ReturnUrl != '') $this->PostBackParams->Add('ReturnUrl', $this->ReturnUrl);

    So my question(s) are:

    1. How do I specify a ReturnUrl?
    2. If successful, how do I access the session variables that vanilla sets?
    3. How can I add additional inputs / variable during registration?

    Thanks for your help guys!
    •  
      CommentAuthorMark
    • CommentTimeJul 25th 2006
     # 2
    You specify a ReturnUrl just like that. When linking to the sign in page, add this to the link:

    people.php?ReturnUrl=where/to/send/them/after.html

    As for accessing the session / cookie variables, there's a pretty decent summary of that over here:

    http://lussumo.com/community/discussion/2654/?Focus=32933#Comment_32933

    Finally, you can take a look at the discovery extension or the extended application form extension to see how I added inputs to registration over there:

    Discovery Extension
    Extended Application Form Extension
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006 edited
     # 3
    Thanks Mark! One last thing, when specifying the ReturnUrl through the link, where are you referencing from? The root directory or the forum directory? If I wanted to retrun to an index page one directory above the forum, would it be this:

    people.php?ReturnUrl=../index.php
    Or this:

    people.php?ReturnUrl=/home/user/index.php
    Neither seem to be working for me.
    • CommentAuthorImmersion
    • CommentTimeJul 25th 2006
     # 4
    i think you must do

    people.php?ReturnUrl=http://www.domain.com/sub/index.php
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006
     # 5
    Hmm, none of these solutions seem to work. Does anyone have a working example of the ReturnUrl variable being set via URL?
    • CommentAuthorImmersion
    • CommentTimeJul 25th 2006
     # 6
    my way is right as if you log out and hover over the sign in link (top right) it is what i said. Obviously you have to change the domain.com and sub to the correct path for you
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006 edited
     # 7
    I see what you mean, Immersion, yet when I alter the URL from

    people.php?ReturnUrl=http://www.MyRealDomain.com/forum/
    to

    people.php?ReturnUrl=http://www.MyRealDomain.com
    it still returns to the forum directory. Do I have to set a variable somewhere else maybe?
    •  
      CommentAuthorMark
    • CommentTimeJul 25th 2006
     # 8
    That's odd. The ReturnUrl should be stored in a hidden input in the page. The next step would be to click your link and then look in the xhtml to make sure that it is getting it properly.
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006
     # 9
    I've done some primary digging, and here's what I've come up with. When you access the sign-in page without a ReturnUrl set, there is a hidden input that stores a blank value. Somehow the script knows to return the user to the main forum page. If you specify a ReturnUrl directly within the URL, the hidden input is updated, and the user is returned to the forum. If you change the ReturnUrl within the URL, no matter what you change it to, the hidden input is updated, but the user is still returned to the main forum, despite the ReturnUrl pointing somewhere else entirely.
    •  
      CommentAuthorMark
    • CommentTimeJul 25th 2006 edited
     # 10
    Here is the logic behind the ReturnUrl on the SignInForm control in Vanilla 1:

    // Automatically redirect if this user isn't a user administrator or there aren't any new applicants
    $AutoRedirect = 1;
    if ($this->Context->Session->User->Permission('PERMISSION_APPROVE_APPLICANTS')) {
    $this->ApplicantCount = $UserManager->GetApplicantCount();
    if ($this->ApplicantCount > 0) $AutoRedirect = 0;
    }
    if ($this->ReturnUrl == '') {
    $this->ReturnUrl = $this->Context->Configuration['FORWARD_VALIDATED_USER_URL'];
    } else {
    $this->ReturnUrl = str_replace('&', '&', $this->ReturnUrl);
    }
    if ($AutoRedirect && $this->ReturnUrl != '') {
    header('location: '.$this->ReturnUrl);
    // die();
    }


    Here is the same thing in plain english:

    If the user has permission to approve new applicants and there are new applicants,
    don't automatically forward him/her.

    Otherwise...

    If there is a return url, do some formatting so it works properly, and send the user to that url.
    •  
      CommentAuthorDinoboff
    • CommentTimeJul 25th 2006 edited
     # 11
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006
     # 12
    It does work with the above, but it still won't work on my forum. To wit:

    http://www.moxiecinema.com/forum/people.php?ReturnUrl=http://www.google.com

    The username and password are both "test." It should redirect to google, but still goes to the main forum page.
    • CommentAuthorImmersion
    • CommentTimeJul 25th 2006
     # 13
    well for me that link takes me to google when i sign in
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006
     # 14
    That's odd. Why wouldn't it for me? I'm using Firefox 1.5.0.4 on WinXP. Perhaps if I clear my cache... now it works!

    What do you think was causing the problem? I cleared my cache and cookies and the problem was resolved. Weird.
    •  
      CommentAuthorDinoboff
    • CommentTimeJul 25th 2006
     # 15
    you were still logged in I think
    • CommentAuthorbjork24
    • CommentTimeJul 25th 2006
     # 16
    No, I was logged out.
Add your comments
    Username Password
  • Format comments as