Skip to content

Commit d8fe1ef

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/2021-log-failed-login-attempts' into main
2 parents aad3187 + 66a1c1f commit d8fe1ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/login/index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function authenticate_user($user, $password, $twofa = ''){
8484

8585
// Remove tmp file
8686
unlink($v_hash);
87-
8887
// Check API answer
8988
if ( $return_var > 0 ) {
9089
sleep(2);
@@ -101,6 +100,8 @@ function authenticate_user($user, $password, $twofa = ''){
101100
unset($output);
102101
if ($data[$user]['TWOFA'] != '') {
103102
if(empty($twofa)){
103+
$_SESSION['login']['username'] = $user;
104+
$_SESSION['login']['password'] = $password;
104105
return false;
105106
}else{
106107
$v_twofa = escapeshellarg($twofa);
@@ -111,7 +112,8 @@ function authenticate_user($user, $password, $twofa = ''){
111112
$error = "<a class=\"error\">"._('Invalid or missing 2FA token')."</a>";
112113
$_SESSION['login']['username'] = $user;
113114
$_SESSION['login']['password'] = $password;
114-
exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_murmur, $output, $return_var);
115+
$v_murmur = escapeshellarg($_POST['murmur']);
116+
exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_murmur, $output, $return_var);
115117
return $error;
116118
unset($_POST['twofa']);
117119
}

0 commit comments

Comments
 (0)