diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php
index 1e18e4e005..e126d9268d 100644
--- a/pandora_console/general/login_page.php
+++ b/pandora_console/general/login_page.php
@@ -35,6 +35,7 @@ switch ($login_screen) {
$logo_title = __('Go to Pandora FMS Website');
break;
case 'logout':
+ case 'double_auth':
$logo_link = 'index.php';
$logo_title = __('Go to Login');
break;
@@ -129,6 +130,22 @@ echo '
echo __('Your session is over. Please close your browser window to close this Pandora session.').'
';
echo '
';
break;
+ case 'double_auth':
+ if (!empty ($page) && !empty ($sec)) {
+ foreach ($_POST as $key => $value) {
+ html_print_input_hidden ($key, $value);
+ }
+ }
+ echo '';
+ echo __('Authenticator code') . '
';
+ echo '
';
+ echo '';
+ html_print_input_text_extended ("auth_code", '', "auth_code", '', '', '' , false, '', 'class="login login_password"', false, true);
+ echo '
';
+ echo '';
+ html_print_submit_button(__("Check code") . ' >', "login_button", false, 'class="sub next_login"');
+ echo '
';
+ break;
default:
if (isset($error_info)) {
echo '' . $error_info['title'] . '
';
diff --git a/pandora_console/index.php b/pandora_console/index.php
index d054197723..e53f31354e 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -167,176 +167,283 @@ if (strlen($search) > 0) {
$searchPage = true;
}
-// Login process
-if (! isset ($config['id_user']) && isset ($_GET["login"])) {
- include_once('include/functions_db.php'); //Include it to use escape_string_sql function
-
- $config["auth_error"] = ""; //Set this to the error message from the authorization mechanism
- $nick = get_parameter_post ("nick"); //This is the variable with the login
- $pass = get_parameter_post ("pass"); //This is the variable with the password
- $nick = db_escape_string_sql($nick);
- $pass = db_escape_string_sql($pass);
-
- // process_user_login is a virtual function which should be defined in each auth file.
- // It accepts username and password. The rest should be internal to the auth file.
- // The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
- // process_user_login should return false in case of errors or invalid login, the nickname if correct
- $nick_in_db = process_user_login ($nick, $pass);
-
- $expired_pass = false;
-
- if (($nick_in_db != false) && ((!is_user_admin($nick)
- || $config['enable_pass_policy_admin']))
- && (defined('PANDORA_ENTERPRISE'))
- && ($config['enable_pass_policy'])) {
- include_once(ENTERPRISE_DIR . "/include/auth/mysql.php");
+// Login process
+if (! isset ($config['id_user'])) {
+ if (isset ($_GET["login"])) {
+ include_once('include/functions_db.php'); //Include it to use escape_string_sql function
- $blocked = login_check_blocked($nick);
-
- if ($blocked) {
- require_once ('general/login_page.php');
- db_pandora_audit("Password expired", "Password expired: ".$nick, $nick);
- while (@ob_end_flush ());
- exit ("