RE: [phplib] logout link only when logged in From: Matt Williams (matt <email protected>)
Date: 03/23/01

> Hi,
>
> I thought this would be a simple task but I can't seem to find an
> elegant way todo this, or I haven't gotten my head around the phplib
> enough yet.
> I want to display a logout link on all pages off my website when a
> user is authenticated. Also on pages that _don't_ require
> authentication. What is the most elegant way of doing this with
> phplib?
>

>From the manual.

A session is authenticated if it contains

if($auth->auth["uid"] != false and time() < $auth->auth["exp"])
{
        echo '<a href="logout.php">Logout</a>';
}

or change false to "nobody" if you're using default authentication

HTH

M@

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>