note 16046 deleted from features.http-auth by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 20:29:40 +0000 |
| Subject: | note 16046 deleted from features.http-auth by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25321@lists.php.net to get a copy of this message | ||
Hi all.
I just want to say few words about RELOGIN button. Which can be enabled with HTTP authentication.
I think after previous few words you will read this text more attentively :-)
So if you wish to use this feature you will have to use SESSIONS (PHP Sessions are good).
1. Generate var LOGINED and set it to false.
2. If user login was good set var LOGINED to true.
3. make session var RELOGIN
4. Use link index.phtml?relogin=1
5. Perform check:
// relogin block
if ( (isset($relogin)) && ((isset($RELOGIN))&&(!$RELOGIN)) )
{
$RELOGIN=true;
$LOGINED=false;
}
elseif ($LOGINED)
{
$RELOGIN=false;
}
// here show user
if (!$LOGINED)
{
Header("WWW-authenticate: basic realm="SpyLOG");
Header("HTTP/1.0 401 Unauthorized");
exit;
}