Create a signout url?
  • Vote Up0Vote Down MatthewAlanMatthewAlan February 2
    Posts: 61

    I am working on a mobile style, and am going to completely redoing the menu, and I would like to pull the sign out button out of it, and put it in a different location. I have been able to do that with the sign in button, but not for the sign out. I am using iWebKit, and since I am not experienced with PHP I don't know what I am doing. I've managed to change the button from Sign In to Sign Out by checking the session. My problem is being able to produce a authenticated URL to sign out.

    Here is the code for my sign button:
    <a class='SignInPopup' href='/index.php/entry/?Target=discussions'>Sign In</a></div>
    That was pretty easy, but how do I get the user to be able to sign out from my button? I think I have to use this:
    $Authenticator->SignOutUrl()
    Any help would be greatly appreciated.

  • 6 Answers sorted by
  • Vote Up0Vote Down dietbriskdietbrisk February 2
    Posts: 16

    Yep, that's pretty much it.

    SignOutUrl(); ?>">Sign Out

  • Vote Up0Vote Down MatthewAlanMatthewAlan February 3
    Posts: 61

    I understand that's how it's done, but I also know that's PHP and I am new to all that, so my real question is how do I throw that in the link?
    <a href="???">Sign Out</a>
    What do I put where the ??? is? It's already in a PHP statement, if that helps.

  • Vote Up0Vote Down MatthewAlanMatthewAlan February 4
    Posts: 61

    Can anyone help me with this?

  • Vote Up0Vote Down lucluc February 4
    Posts: 315

    A simple grep would have gave you the info in less than 2 minutes :

    luc@cadsuane:~/dev/lussumo/Garden$ grep -i "sign out" */*/*/*

    applications/garden/views/admin.master.php: echo Anchor(Gdn::Translate('Sign Out'), str_replace('{Session_TransientKey}', $Session->TransientKey(), $Authenticator->SignOutUrl()));

    applications/garden/views/default.master.php: $this->Menu->AddLink('SignOut', Gdn::Translate('Sign Out'), $Authenticator->SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));

  • Vote Up0Vote Down MatthewAlanMatthewAlan February 5
    Posts: 61

    I'm sorry, but that doesn't make any sense to me :/

  • Vote Up0Vote Down scorchptscorchpt February 5
    Posts: 23

    You can do something like this. ;)
    Just do a echo in PHP.
    link

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Tagged

In this Discussion