|
@@ -53,10 +53,10 @@
|
|
}
|
|
}
|
|
|
|
|
|
//if the username session is not set the check username and password
|
|
//if the username session is not set the check username and password
|
|
- if (strlen($_SESSION['username']) == 0 && isset($_REQUEST["username"]) && isset($_REQUEST["password"])) {
|
|
|
|
|
|
+ if (strlen($_SESSION['username']) == 0) {
|
|
|
|
|
|
//clear the menu
|
|
//clear the menu
|
|
- $_SESSION["menu"] = "";
|
|
|
|
|
|
+ unset($_SESSION["menu"]);
|
|
|
|
|
|
//clear the template only if the template has not been assigned by the superadmin
|
|
//clear the template only if the template has not been assigned by the superadmin
|
|
if (strlen($_SESSION['domain']['template']['name']) == 0) {
|
|
if (strlen($_SESSION['domain']['template']['name']) == 0) {
|
|
@@ -65,11 +65,11 @@
|
|
|
|
|
|
//validate the username and password
|
|
//validate the username and password
|
|
$auth = new authentication;
|
|
$auth = new authentication;
|
|
- if (strlen($_REQUEST["username"]) > 0) {
|
|
|
|
|
|
+ if (isset($_REQUEST["username"]) && isset($_REQUEST["password"])) {
|
|
$auth->username = $_REQUEST["username"];
|
|
$auth->username = $_REQUEST["username"];
|
|
$auth->password = $_REQUEST["password"];
|
|
$auth->password = $_REQUEST["password"];
|
|
}
|
|
}
|
|
- if (strlen($_REQUEST["key"]) > 0) {
|
|
|
|
|
|
+ if (isset($_REQUEST["key"])) {
|
|
$auth->key = $_REQUEST["key"];
|
|
$auth->key = $_REQUEST["key"];
|
|
}
|
|
}
|
|
$auth->debug = false;
|
|
$auth->debug = false;
|
|
@@ -97,6 +97,7 @@
|
|
openlog('FusionPBX', LOG_NDELAY, LOG_AUTH);
|
|
openlog('FusionPBX', LOG_NDELAY, LOG_AUTH);
|
|
syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] authentication failed for ".$result["username"]);
|
|
syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] authentication failed for ".$result["username"]);
|
|
closelog();
|
|
closelog();
|
|
|
|
+
|
|
//redirect the user to the login page
|
|
//redirect the user to the login page
|
|
$target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["PHP_SELF"];
|
|
$target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["PHP_SELF"];
|
|
messages::add($text['message-invalid_credentials'], 'negative');
|
|
messages::add($text['message-invalid_credentials'], 'negative');
|