Ver Fonte

Move the login redirect to check_auth.php

FusionPBX há 4 anos atrás
pai
commit
f0e7016665
1 ficheiros alterados com 6 adições e 16 exclusões
  1. 6 16
      index.php

+ 6 - 16
index.php

@@ -17,16 +17,17 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2020
+	Portions created by the Initial Developer are Copyright (C) 2008-2021
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
 	Mark J. Crane <[email protected]>
 */
+
 //include root
 	include "root.php";
 
-// start the session
+//start the session
 	ini_set("session.cookie_httponly", True);
 	if (!isset($_SESSION)) { session_start(); }
 
@@ -47,7 +48,7 @@
 		exit;
 	}
 
-// if not logged in, clear the session variables
+//if not logged in, clear the session variables
 	//if (strlen($_SESSION["username"]) == 0) {
 	//	session_unset();
 	//	session_destroy();
@@ -56,19 +57,8 @@
 //adds multiple includes
 	require_once "resources/require.php";
 
-// if logged in, redirect to login destination
-	if (isset($_SESSION["username"]) && (strlen($_SESSION["username"]) > 0)) {
-		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";
-		}
-	}
-	else {
+//if logged in, redirect to login destination
+	if (!isset($_SESSION["username"])) {
 		//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";