mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-27 07:31:09 +01:00
Update w/ logout() method
This commit is contained in:
@@ -74,6 +74,20 @@ class HTTPAuth
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Logs out the administrative user
|
||||
*/
|
||||
public function logout(): void
|
||||
{
|
||||
session_unset(); // unset all session variables
|
||||
session_destroy(); // destroy the session
|
||||
$redirectUrl = $_SERVER['REQUEST_URI'];
|
||||
if (strpos($redirectUrl, '/login') === false) {
|
||||
header('Location: /login?action=' . urlencode($redirectUrl));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the current authentication config
|
||||
* return array $config
|
||||
|
||||
Reference in New Issue
Block a user