From 9f7133ac4f13a5bee19561cab4fae55684b6cd56 Mon Sep 17 00:00:00 2001 From: fusionate Date: Sat, 28 Jan 2023 00:19:00 +0000 Subject: [PATCH] Login: Change destination setting type. --- index.php | 6 +++--- resources/check_auth.php | 6 +++--- resources/login.php | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index faedb88f4f..6025e0d694 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2022 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -47,8 +47,8 @@ //if logged in, redirect to login destination if (isset($_SESSION["username"])) { - if (isset($_SESSION['login']['destination']['url'])) { - header("Location: ".$_SESSION['login']['destination']['url']); + if (isset($_SESSION['login']['destination']['text'])) { + header("Location: ".$_SESSION['login']['destination']['text']); } elseif (file_exists($_SERVER["PROJECT_ROOT"]."/core/dashboard/app_config.php")) { header("Location: ".PROJECT_PATH."/core/dashboard/"); } diff --git a/resources/check_auth.php b/resources/check_auth.php index e7fe47e3c1..0022889310 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2021 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -308,8 +308,8 @@ } header("Location: ".$redirect_path); } - elseif (isset($_SESSION['login']['destination']['url'])) { - header("Location: ".$_SESSION['login']['destination']['url']); + elseif (isset($_SESSION['login']['destination']['text'])) { + header("Location: ".$_SESSION['login']['destination']['text']); } elseif (file_exists($_SERVER["PROJECT_ROOT"]."/core/dashboard/app_config.php")) { header("Location: ".PROJECT_PATH."/core/dashboard/"); } diff --git a/resources/login.php b/resources/login.php index 5184fc5849..89c4d3ef26 100644 --- a/resources/login.php +++ b/resources/login.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -250,15 +250,15 @@ if (!isset($_SESSION['login']['domain_name_visible']['boolean'])) { $_SESSION['login']['domain_name_visible']['boolean'] = null; } //santize the login destination url and set a default value - if (isset($_SESSION['login']['destination']['url'])) { - $destination_path = parse_url($_SESSION['login']['destination']['url'])['path']; - $destination_query = parse_url($_SESSION['login']['destination']['url'])['query']; + if (isset($_SESSION['login']['destination']['text'])) { + $destination_path = parse_url($_SESSION['login']['destination']['text'])['path']; + $destination_query = parse_url($_SESSION['login']['destination']['text'])['query']; $destination_path = preg_replace('#[^a-zA-Z0-9_\-\./]#', '', $destination_path); $destination_query = preg_replace('#[^a-zA-Z0-9_\-\./&=]#', '', $destination_query); - $_SESSION['login']['destination']['url'] = (strlen($destination_query) > 0) ? $destination_path.'?'.$destination_query : $destination_path; + $_SESSION['login']['destination']['text'] = (strlen($destination_query) > 0) ? $destination_path.'?'.$destination_query : $destination_path; } else { - $_SESSION['login']['destination']['url'] = PROJECT_PATH."/core/dashboard/"; + $_SESSION['login']['destination']['text'] = PROJECT_PATH."/core/dashboard/"; } if (strlen($_REQUEST['path']) > 0) { @@ -293,7 +293,7 @@ $token = $object->create('login'); echo "
\n"; - echo "
\n"; + echo "\n"; echo "
\n"; echo "
\n"; if ($_SESSION['login']['domain_name_visible']['boolean'] == "true") {