From 2ed2fe32b4ba2ccf0d47f94ee403aa93609e9e61 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 1 Aug 2021 17:13:59 -0600 Subject: [PATCH] Redirect sitll needed here for clicking on the logo. --- index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a113a86e7b..ab5300a56a 100644 --- a/index.php +++ b/index.php @@ -58,7 +58,18 @@ require_once "resources/require.php"; //if logged in, redirect to login destination - if (!isset($_SESSION["username"])) { + if (isset($_SESSION["username"])) { + if (isset($_SESSION['login']['destination']['url'])) { + header("Location: ".$_SESSION['login']['destination']['url']); + } elseif (file_exists($_SERVER["PROJECT_ROOT"]."/core/user_settings/user_dashboard.php")) { + header("Location: ".PROJECT_PATH."/core/user_settings/user_dashboard.php"); + } + else { + require_once "resources/header.php"; + require_once "resources/footer.php"; + } + } + else { //use custom index, if present, otherwise use custom login, if present, otherwise use default login if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/index.php")) { require_once "themes/".$_SESSION['domain']['template']['name']."/index.php";