Add ability to set custom logout destination (#6806)

Allow administrators to set a custom default setting called logout_destination which will redirect the user to a destination of their choosing.
This commit is contained in:
emak-Corey 2023-09-28 11:35:50 -04:00 committed by GitHub
parent 0773a346c2
commit 434b691883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -27,6 +27,14 @@
//includes files //includes files
require_once __DIR__ . "/resources/require.php"; require_once __DIR__ . "/resources/require.php";
//use custom logout destination if set otherwise redirect to the index page
if (isset($_SESSION["login"]["logout_destination"]["text"])){
$logout_destination = $_SESSION["login"]["logout_destination"]["text"];
}
else {
$logout_destination = PROJECT_PATH."/";
}
//destroy session //destroy session
session_unset(); session_unset();
session_destroy(); session_destroy();
@ -96,8 +104,8 @@
} }
} }
//redirect the user to the index page //redirect the user to the logout page
header("Location: ".PROJECT_PATH."/"); header("Location: ".$logout_destination);
exit; exit;
?> ?>