Kaynağa Gözat

Add ability to set custom logout destination (#6806)

Allow administrators to set a custom default setting called logout_destination which will redirect the user to a destination of their choosing.
emak-Corey 1 yıl önce
ebeveyn
işleme
75d25b949a
1 değiştirilmiş dosya ile 11 ekleme ve 3 silme
  1. 11 3
      logout.php

+ 11 - 3
logout.php

@@ -26,6 +26,14 @@
 
 
 //includes files
 //includes files
 	require_once __DIR__ . "/resources/require.php";
 	require_once __DIR__ . "/resources/require.php";
+	
+//use custom logout destination if set otherwise redirect to the index page
+	if (isset($_SESSION["login"]["logout_destination"]["text"])){
+		$logout_destination = $_SESSION["login"]["logout_destination"]["text"];
+	}
+	else {
+		$logout_destination = PROJECT_PATH."/";
+	}
 
 
 //destroy session
 //destroy session
 	session_unset();
 	session_unset();
@@ -96,8 +104,8 @@
 		}
 		}
 	}
 	}
 
 
-//redirect the user to the index page
-	header("Location: ".PROJECT_PATH."/");
+//redirect the user to the logout page
+	header("Location: ".$logout_destination);
 	exit;
 	exit;
 
 
-?>
+?>