From 434b69188377faca4320dfff843e82894779c484 Mon Sep 17 00:00:00 2001 From: emak-Corey Date: Thu, 28 Sep 2023 11:35:50 -0400 Subject: [PATCH] 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. --- logout.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/logout.php b/logout.php index 0f9b7bf694..176edd78ae 100644 --- a/logout.php +++ b/logout.php @@ -26,6 +26,14 @@ //includes files 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 session_unset(); @@ -96,8 +104,8 @@ } } -//redirect the user to the index page - header("Location: ".PROJECT_PATH."/"); +//redirect the user to the logout page + header("Location: ".$logout_destination); exit; -?> \ No newline at end of file +?>