Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi, here i am with another question ...
This time http auth, more specific the logout of an applicacion logged by this code:Code: Select all
$auth = false;
if (isset($_SERVER['PHP_AUTH_USER']) &&
isset($_SERVER['PHP_AUTH_PW'])) {
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
$oMember->Set('username', $username);
$oMember->Set('password', $password);
$results = $oMember->SearchUser();
$number = count($results);
if($number != 0) {
$auth = true;
}
}
if(!$auth) {
header('WWW-Authenticate: Basic realm="My Auth"');
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
}
else {
echo 'Welcome ...';
$_SESSION['member_username'] = $username;
$_SESSION['member_password'] = $password;
echo "<meta http-equiv=\"Refresh\"content=\"2; URL=index.php?order=title\">";
}In my best approachs the login windows appears again on the screen and when i hit enter the user loggout.
The other approach that i am using rigth now is a javascript function who closes the browser.
I need a clean logout for my users, any help will be appreciated.
Thanx.
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]