diff --git a/core/user_settings/app_languages.php b/core/user_settings/app_languages.php index 39fe299b3b..4214f619bb 100644 --- a/core/user_settings/app_languages.php +++ b/core/user_settings/app_languages.php @@ -194,4 +194,19 @@ $text['login-message_dismiss']['es-cl'] = "Despedir"; $text['login-message_dismiss']['pt-pt'] = "Demitir"; $text['login-message_dismiss']['fr-fr'] = "Rejeter"; + + $text['label-username']['en-us'] = "Username"; + $text['label-username']['es-cl'] = "Nombre de Usuario"; + $text['label-username']['pt-pt'] = "Nome de Utilizador"; + $text['label-username']['fr-fr'] = "Nom d'Utilisateur"; + + $text['label-password']['en-us'] = "Password"; + $text['label-password']['es-cl'] = "Contraseña"; + $text['label-password']['pt-pt'] = "Password"; + $text['label-password']['fr-fr'] = "Mot de Passe"; + + $text['label-domain']['en-us'] = "Domain"; + $text['label-domain']['es-cl'] = "Dominio"; + $text['label-domain']['pt-pt'] = "Domínio"; + $text['label-domain']['fr-fr'] = "Domaine"; ?> diff --git a/index.php b/index.php index b899787227..95a3d81b67 100644 --- a/index.php +++ b/index.php @@ -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 "

\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"; + } +} ?> \ No newline at end of file diff --git a/login.php b/login.php index d61406d994..6975d81eaa 100644 --- a/login.php +++ b/login.php @@ -21,7 +21,7 @@ the Initial Developer. All Rights Reserved. Contributor(s): - Mark J Crane + Mark J. Crane */ include "root.php"; @@ -35,6 +35,9 @@ include "root.php"; //do nothing } elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) { //original directory + } 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")){ //linux } elseif (file_exists("/usr/local/etc/fusionpbx/config.php")){ @@ -47,7 +50,7 @@ include "root.php"; //adds multiple includes require_once "resources/require.php"; -//include the login +//use custom login, if present, otherwise use default login if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/login.php")){ require_once "themes/".$_SESSION['domain']['template']['name']."/login.php"; } diff --git a/resources/login.php b/resources/login.php index 2f1c99c5ba..0179a4f964 100644 --- a/resources/login.php +++ b/resources/login.php @@ -85,62 +85,32 @@ } //show the content - echo "

"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - + echo "
\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "
\n"; if ($_SESSION['login']['domain_name.visible']['boolean'] == "true") { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; } - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo " ".$text['label-username'].":\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo " ".$text['label-password'].":\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo " ".$text['label-domain'].":\n"; - echo "\n"; if (count($_SESSION['login']['domain_name']) > 0) { - echo " \n"; + echo " \n"; foreach ($_SESSION['login']['domain_name'] as &$row) { - echo " \n"; + echo " \n"; } - echo " \n"; + echo "\n"; + echo "
"; } else { - echo " \n"; + echo "
\n"; } - echo "
\n"; - echo "\n"; - echo " \n"; - echo "
\n"; + echo "
"; + echo "\n"; echo "
"; - echo "
"; + echo ""; //add the footer + $default_login = true; include "resources/footer.php"; ?> \ No newline at end of file diff --git a/themes/enhanced/login.php b/themes/enhanced/login.php deleted file mode 100644 index ae7bda5675..0000000000 --- a/themes/enhanced/login.php +++ /dev/null @@ -1,38 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2013 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J. Crane -*/ -include "root.php"; - -//show the index page - 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 "

\n"; - require_once "resources/footer.php"; - } -?> \ No newline at end of file diff --git a/themes/enhanced/template.php b/themes/enhanced/template.php index 0f408c3328..95b9016200 100644 --- a/themes/enhanced/template.php +++ b/themes/enhanced/template.php @@ -55,7 +55,7 @@ DIV#page { left: 0px; right: 0px; bottom: 0px; - padding: 10px; + padding: 0px; overflow: auto; } @@ -95,6 +95,30 @@ if ( ?> +DIV#copyright { + background-color: #000; + bottom: 0px; + left: 0px; + right: 0px; + height: 20px; + -khtml-opacity: 0.2; + -moz-opacity: 0.2; + -ms-filter: "alpha(opacity=20)"; + filter: alpha(opacity=20); + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.2); + opacity: 0.2; + text-align: center; + vertical-align: middle; + padding-bottom: 0px; + padding-top: 8px; +} + +.copyright { + font-size: 11px; + font-family: arial; + color: #fff; +} + img { border: none; } @@ -378,9 +402,6 @@ table.tr_hover tr:hover td a { /*background-color: #FFFFFF;*/ } -.headermain { - /*background-color: #7FAEDE;*/ -} .frm { border: solid 1px #CCCCCC; @@ -1108,49 +1129,52 @@ legend { ?>
- - -
- - - - - - 0) { - ?> - - - - - - - - - + - - - -
- 0) { - echo ""; - } - else { - echo ""; - } - } - ?> - - "; - echo " ".$text['theme-label-user']." "; - echo " "; - echo $_SESSION['username']; - if (count($_SESSION['domains']) > 1) { - echo "@".$_SESSION["user_context"]; - } - echo ""; - echo "\n"; - } + + + + + + 0) { + ?> + + + + + + + + + + + + + +
+ + + + + +
+ 0) { + echo ""; + } + else { + if (!$default_login) { + echo ""; + } + } + } + ?> + + "; + echo " ".$text['theme-label-user']." "; + echo " "; + echo $_SESSION['username']; + if (count($_SESSION['domains']) > 1) { + echo "@".$_SESSION["user_context"]; + } + echo ""; + echo "\n"; + } - //logged in show the domains block - if (strlen($_SESSION["username"]) > 0 && permission_exists("domain_select") && count($_SESSION['domains']) > 1) { - echo ""; - echo "       ".$text['theme-label-domain']." "; - echo " ".$_SESSION['domain_name'].""; - echo " "; - echo ""; - } + //logged in show the domains block + if (strlen($_SESSION["username"]) > 0 && permission_exists("domain_select") && count($_SESSION['domains']) > 1) { + echo ""; + echo "       ".$text['theme-label-domain']." "; + echo " ".$_SESSION['domain_name'].""; + echo " "; + echo ""; + } - //logged out show the login - if ($_SERVER['PHP_SELF'] != PROJECT_PATH."/resources/install.php") { - if (strlen($_SESSION["username"]) == 0) { + // login form + if ($_SERVER['PHP_SELF'] != PROJECT_PATH."/resources/install.php" && !$default_login) { + if (strlen($_SESSION["username"]) == 0) { //add multi-lingual support require_once "core/user_settings/app_languages.php"; foreach($text as $key => $value) { @@ -1167,10 +1191,10 @@ legend { echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($_SESSION['login']['domain_name.visible']['boolean'] == "true") { @@ -1187,7 +1211,7 @@ legend { echo " \n"; } else { - echo " \n"; + echo " \n"; } echo " \n"; } @@ -1199,60 +1223,95 @@ legend { echo "
\n"; - echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " "; echo ""; + } } + ?> +
+
+ + + + +
+ +
+
+ + +
+ + +
+ + + + + +
+ +
+


+
-
- - - - -
- -
-
- \n"; - echo "
\n"; - echo "© Copyright 2008 - ".date("Y")." fusionpbx.com. All rights reserved.\n"; - echo "

\n"; - } - else { - echo "\n"; - } - ?> -
+ fusionpbx.com. All rights reserved.\n"; + echo ""; + ?> + - + \ No newline at end of file