Announcement

Collapse
No announcement yet.

Logout with hash

Collapse
X
Collapse
First Prev Next Last
  • Filter
  • Time
  • Show
Clear All
new posts

    Logout with hash

    I have this for my site: https://www.vbulletin.com/forum/blog...n-your-website

    In the end it says

    PHP Code:
          else     {         echo 'Already logged in';     } 
    I would like to have a link that can logout.

    I have tried this

    PHP Code:

    $hash 
    vB5_Cookie::get('password'vB5_Cookie::TYPE_STRING);
    echo 
    '<a href="https://www.zoopet.com/forum/auth/logout?logouthash=' $hash '" class="btn btn-default">Logout</a>'
    But there is no value to $hash. Is there a good way to get that value.

    #2
    Try this:
    PHP Code:
    $api Api_InterfaceAbstract::instance();
    $user $api->callApi('user''fetchUserinfo', array());
    echo 
    '<a href="https://www.zoopet.com/forum/auth/logout?logouthash=' $user['logouthash'] . '" class="btn btn-default">Logout</a>'

    This code is untested but I think it will work.

    Comment


      #3
      Now the code is tested. It works great. Thank you

      Comment


        #4
        Glad to be of help.

        bill murray pointing GIF

        Comment


          #5
          I got the full code working with login/logout on external pages on Zoopet now. Do you want it and share it?

          Comment


            #6
            Sure you can post it here. Thanks.

            Comment

            Working...
            X