Move the login redirect to check_auth.php
This commit is contained in:
parent
c9e44dca4b
commit
df3e85dd17
22
index.php
22
index.php
|
|
@ -17,16 +17,17 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
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.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J. Crane <markjcrane@fusionpbx.com>
|
Mark J. Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//include root
|
//include root
|
||||||
include "root.php";
|
include "root.php";
|
||||||
|
|
||||||
// start the session
|
//start the session
|
||||||
ini_set("session.cookie_httponly", True);
|
ini_set("session.cookie_httponly", True);
|
||||||
if (!isset($_SESSION)) { session_start(); }
|
if (!isset($_SESSION)) { session_start(); }
|
||||||
|
|
||||||
|
|
@ -47,7 +48,7 @@
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if not logged in, clear the session variables
|
//if not logged in, clear the session variables
|
||||||
//if (strlen($_SESSION["username"]) == 0) {
|
//if (strlen($_SESSION["username"]) == 0) {
|
||||||
// session_unset();
|
// session_unset();
|
||||||
// session_destroy();
|
// session_destroy();
|
||||||
|
|
@ -56,19 +57,8 @@
|
||||||
//adds multiple includes
|
//adds multiple includes
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
|
|
||||||
// if logged in, redirect to login destination
|
//if logged in, redirect to login destination
|
||||||
if (isset($_SESSION["username"]) && (strlen($_SESSION["username"]) > 0)) {
|
if (!isset($_SESSION["username"])) {
|
||||||
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 {
|
|
||||||
//use custom index, if present, otherwise use custom login, if present, otherwise use default login
|
//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")) {
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/index.php")) {
|
||||||
require_once "themes/".$_SESSION['domain']['template']['name']."/index.php";
|
require_once "themes/".$_SESSION['domain']['template']['name']."/index.php";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue