mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Make amount of failed logins configurable (defaults to 3)
This commit is contained in:
@@ -769,3 +769,11 @@ $config['disable_version_check'] = false;
|
||||
*/
|
||||
|
||||
$config['enable_eqsl_massdownload'] = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Lock Account after n failed login-attempts
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$config['max_login_attempts'] = 3;
|
||||
|
||||
@@ -610,7 +610,12 @@ class User_Model extends CI_Model {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if ($u->row()->login_attempts > 3) {
|
||||
if ($this->config->item('max_login_attempts')) {
|
||||
$maxattempts = $this->config->item('max_login_attempts');
|
||||
} else {
|
||||
$maxattempts = 3;
|
||||
}
|
||||
if ($u->row()->login_attempts > $maxattempts) {
|
||||
$uid = $u->row()->user_id;
|
||||
log_message('debug', "User ID: [$uid] Login rejected because of too many failed login attempts.");
|
||||
return 3;
|
||||
|
||||
Reference in New Issue
Block a user