mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
also clear browser basic auth via additional fhclogout cookie in private/logout.php
This commit is contained in:
@@ -72,6 +72,7 @@ class Auth extends FHC_Controller
|
||||
{
|
||||
$this->load->library('AuthLib');
|
||||
$this->authlib->logout();
|
||||
redirect('/Cis/Auth/login', 'refresh');
|
||||
setcookie('fhclogout', 'fhclogout', 0, '/');
|
||||
redirect(base_url('/cis/private/logout.php'), 'refresh');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require_once('../../config/cis.config.inc.php');
|
||||
|
||||
if (isset($_COOKIE['fhclogout']) && ($_COOKIE['fhclogout'] === 'fhclogout'))
|
||||
{
|
||||
setcookie('fhclogout', '', -1, '/');
|
||||
http_response_code(401);
|
||||
header('WWW-Authenticate: Basic realm="' . AUTH_NAME . '"');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>FH-Complete logout Basic Auth</title>
|
||||
<meta http-equiv="refresh" content="2; url=<?php echo APP_ROOT . 'cis/'; ?>"/>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function logout()
|
||||
{
|
||||
console.log('FH-Complete logout Basic Auth');
|
||||
window.location.href = '<?php echo APP_ROOT . 'cis/'; ?>';
|
||||
}
|
||||
|
||||
logout();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
http_response_code(303);
|
||||
header('Location:' . APP_ROOT . 'cis/');
|
||||
}
|
||||
Reference in New Issue
Block a user