diff --git a/app/dialplan/resources/switch/conf/dialplan/490_do-not-disturb.xml b/app/dialplan/resources/switch/conf/dialplan/490_do-not-disturb.xml index fc722d95ea..d4943722e6 100644 --- a/app/dialplan/resources/switch/conf/dialplan/490_do-not-disturb.xml +++ b/app/dialplan/resources/switch/conf/dialplan/490_do-not-disturb.xml @@ -1,6 +1,6 @@ - + diff --git a/index.php b/index.php index 50b8a1dcca..7c490f1d48 100644 --- a/index.php +++ b/index.php @@ -46,28 +46,35 @@ include "root.php"; } // if not logged in, clear the session variables -if (strlen($_SESSION["username"]) == 0) { - session_unset(); - session_destroy(); -} + if (strlen($_SESSION["username"]) == 0) { + session_unset(); + session_destroy(); + } //adds multiple includes require_once "resources/require.php"; // if logged in, redirect to login destination -if (strlen($_SESSION["username"]) > 0) { - header("Location: ".$_SESSION['login']['destination']['url']); -} -else { - //use custom index, if present, otherwise use custom login, if present, otherwise use default login - if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/index.php")) { - require_once "themes/".$_SESSION['domain']['template']['name']."/index.php"; - } - else if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/login.php")) { - require_once "themes/".$_SESSION['domain']['template']['name']."/login.php"; + if (strlen($_SESSION["username"]) > 0) { + if (strlen($_SESSION['login']['destination']['url']) > 0) { + header("Location: ".$_SESSION['login']['destination']['url']); + } + else { + require_once "resources/header.php"; + require_once "resources/header.php"; + } } else { - require_once "resources/login.php"; + //use custom index, if present, otherwise use custom login, if present, otherwise use default login + if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/index.php")) { + require_once "themes/".$_SESSION['domain']['template']['name']."/index.php"; + } + else if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/login.php")) { + require_once "themes/".$_SESSION['domain']['template']['name']."/login.php"; + } + else { + require_once "resources/login.php"; + } } -} + ?> \ No newline at end of file