Login Changes:

If visiting /index.php and /themes/[theme]/index.php exists, will load it.
If visiting /index.php and /themes/[theme]/login.php exists, will load it.
If NEITHER exist, will load /resources/login.php.

If visiting /login.php and /themes/[theme]/login.php exists, will load it.
If DOESN'T exist, will load /resources/login.php/

/resources/login.php reworked, Enhanced theme reworked.
This commit is contained in:
Nate Jones
2014-07-27 00:13:52 +00:00
parent 5e13986a2b
commit b244cd2c91
6 changed files with 206 additions and 188 deletions

View File

@@ -25,6 +25,9 @@
*/
include "root.php";
//clear the session variables
session_start();
//if config.php file does not exist then redirect to the install page
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
//do nothing
@@ -33,9 +36,9 @@ include "root.php";
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php")) {
//move config.php from the includes to resources directory.
rename($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php", $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php");
} elseif (file_exists("/etc/fusionpbx/config.php")){
} elseif (file_exists("/etc/fusionpbx/config.php")) {
//linux
} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")){
} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
//bsd
} else {
header("Location: ".PROJECT_PATH."/resources/install.php");
@@ -45,14 +48,20 @@ include "root.php";
//adds multiple includes
require_once "resources/require.php";
//show the index page
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/index.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 {
require_once "resources/require.php";
require_once "resources/header.php";
echo "<br /><br />\n";
require_once "resources/footer.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";
}
}
?>