Update User.php and function logout() to redirect at index

This commit is contained in:
Florin-Ciprian Bodin
2023-11-28 06:32:31 +02:00
committed by GitHub
parent 79ad9d8c05
commit ad5bfabbf6

View File

@@ -77,6 +77,12 @@ class User
*/
public function logout()
{
global $request, $config;
$autoindex_u = empty($request->server('PHP_SELF')) ? $config->__get('base_dir') : $request->server('PHP_SELF');
$autoindex_a = str_replace(array('&logout=true', '&logout=true'), array('', ''), $autoindex_u);
$home = new Url(Url::html_output($autoindex_a), true);
$home->redirect();
throw new ExceptionDisplay('You are not logged in.');
}