HTTP AUTHENTICATION and LOGOUT Problem
| From: | Ermelindo Mauriello | Date: | Tue, 27 Jun 2000 11:09:17 +0000 |
| Subject: | HTTP AUTHENTICATION and LOGOUT Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3311@lists.php.net to get a copy of this message | ||
I've wrote an application using mod_auth_ldap for authentication with
apache.
I need to put a Logout button to exit from the application and return to
a
non-protected index file.
I've done something like that:
<?
if ($REMOTE_USER==$user) {
Header( "WWW-authenticate: basic realm=\"S.C.T.R. -
Utente\"");
Header("HTTP/1.0 401 Unauthorized");
?><script
language="javascript">document.location='../';
</scrip
t><?
exit;
}
?>
<script language="javascript">document.location='index.php3p';
</script>
If the user press the logout button, I redirect it to the above file.
The file forces the user to login with another account or press cancel
to authentication. If it login with another account it will be
redirected
to the application, if it press cancel it is redirected to a
non-protected index
page.
It works good with Netscape, but have some trouble with Explorer since
this last
doesn't present a Authentication failed box, but present the login box.
Is there another way to do this ?
Another problem is that I can't read the PHP_AUTH_USER, bu I have to
read REMOTE_USER.
Thanks
--
E.Mauriello <inmaer@inteltec.it>
Network Engineer
In.Tel.Tec. SpA
Networked Applications Division
Salita Scudillo, 20
80131 Napoli (Italia)
Tel.+39081-5921418
Fax +39081-5922026