Skip to content

Commit

Permalink
tests update_login_attempts done
Browse files Browse the repository at this point in the history
fixed strtotime params in `update_login_attempts`
changed config var `update_last_login_attempt` to true,
  • Loading branch information
REJack committed May 14, 2016
1 parent 4c3aec4 commit e4aa1f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

'max_login_attempt' => 10,
'max_login_attempt_per_minutes' => 5,
'update_last_login_attempt' => false,
'update_last_login_attempt' => true,

'login_with_name' => false,

Expand Down
3 changes: 2 additions & 1 deletion application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ public function update_login_attempts($email) {

$data = array();

if (strtotime($row->last_login_attempt) > strtotime("-"+$this->config_vars['max_login_attempt_per_minutes']+" minutes")) {
$minutes = $this->config_vars['max_login_attempt_per_minutes'];
if (strtotime($row->last_login_attempt) > strtotime("-$minutes minutes")) {
$data['login_attempts'] = $row->login_attempts + 1;

if($this->config_vars['update_last_login_attempt']){
Expand Down

0 comments on commit e4aa1f5

Please sign in to comment.