From e2128166c33d066975d21d0136f9b7b489d6449b Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 31 Jul 2021 22:55:48 -0600 Subject: [PATCH] Move the login destination here so it will work at the user level. --- resources/check_auth.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/check_auth.php b/resources/check_auth.php index 9cfc096a33..7dfe03b66b 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -294,6 +294,17 @@ unset($sql, $parameters, $result, $row); } } + + //if logged in, redirect to login destination + if (strlen($_SESSION['login']['destination']['url']) > 0) { + 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"; + } } //set the time zone