From b24c55f14923ea84bfa455dfd6229d5ec1772506 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 4 Aug 2021 22:38:48 -0600 Subject: [PATCH] Only redirect when not using the key. --- resources/check_auth.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index 55ba3631f1..9453d53a74 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -296,15 +296,18 @@ } //if logged in, redirect to login destination - 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"; + if (!isset($_REQUEST["key"])) { + 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"; + } } + } //set the time zone