1

Topic: Question about logout.

Hello. Im trying to integrate punbb:s logout in my own logoutscript. Everything seems to work fine but I have a question about the following code from punbb:s logoutfunction:

    if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id'])
    {
        header('Location: index.php');
        exit;
    }

What is it doing and what will happen if I take it away? As I can see it still works as normal. I dont want to send the users id to my logout file, "?action=out&id=5576", when loging out and it dosn't seems to be necessary if I remove the code above.

/Peps

2 (edited by chris9902 2005-11-24 11:33)

Re: Question about logout.

that means.

if (user is guset) or (no id isset) or (id does not equal user id)
send them to index.php
exit script

I would not remove it. Without looking at all the code I can't say 100% but things like this are important most of the time.

Re: Question about logout.

I dont want to send the users id to my logout file, "?action=out&id=5576", when loging out and it dosn't seems to be necessary if I remove the code above.

Removing the is_guest thing will mess with things wink
And as for removing the checks on $_GET['id'], you can, but I can then post an image to login.php?action=logout and everyone would be logged out when they visited the thread tongue

4

Re: Question about logout.

Ok thanks. I think Ill keep it then.

/Peps