Skip to content

Commit bc58fbc

Browse files
xmacanTheWitness
andauthored
add account disable log message (#5209)
* add account disable log message * Update auth.php --------- Co-authored-by: TheWitness <[email protected]>
1 parent 3fc30d8 commit bc58fbc

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/auth.php

+13-6
Original file line numberDiff line numberDiff line change
@@ -4327,22 +4327,29 @@ function secpass_login_process($username) {
43274327
}
43284328

43294329
if (db_column_exists('user_auth', 'lastfail')) {
4330-
$user = db_fetch_row_prepared("SELECT id, username, lastfail, failed_attempts, `locked`, password
4330+
$user = db_fetch_row_prepared("SELECT id, username, lastfail, failed_attempts, `locked`, enabled, password
43314331
FROM user_auth
43324332
WHERE username = ?
4333-
AND realm = 0
4334-
AND enabled = 'on'",
4333+
AND realm = 0",
43354334
array($username));
43364335
} else {
4337-
$user = db_fetch_row_prepared("SELECT id, username, password
4336+
$user = db_fetch_row_prepared("SELECT id, username, password, enabled
43384337
FROM user_auth
43394338
WHERE username = ?
4340-
AND realm = 0
4341-
AND enabled = 'on'",
4339+
AND realm = 0",
43424340
array($username));
43434341
}
43444342

43454343
if (cacti_sizeof($user)) {
4344+
if ($user['enabled'] != 'on') {
4345+
$error = true;
4346+
$error_msg = __('Access Denied! Login Failed.');
4347+
4348+
cacti_log(sprintf('LOGIN FAILED: User %s, account disabled.', $username), false, 'AUTH');
4349+
4350+
return array();
4351+
}
4352+
43464353
if (trim($password) == '') {
43474354
/* error */
43484355
$error = true;

0 commit comments

Comments
 (0)