Skip to content

Commit

Permalink
avoid notices on login screen - fix for #401
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Mar 25, 2019
1 parent 3474d3d commit 1a7b350
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wbce/framework/class.login.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function increase_attempts($increment=1)

$interval = $now - $timestamp;

if($interval > $this->time_frame + 2*pow(2,($attempts-$this->max_attempts))*$this->login_delay){
if($interval > $this->timeframe + 2*pow(2,($attempts-$this->max_attempts))*$this->login_delay){
// it's too long ago, forget the db entry and reset to the first attempt
$attempts = $increment;
}
Expand All @@ -311,7 +311,7 @@ public function increase_attempts($increment=1)
$sql = "UPDATE `".TABLE_PREFIX."blocking` SET `attempts` = '$attempts', `timestamp` = '$timestamp' WHERE `source_ip` = '$client_ip'";
$database->query($sql);

if($interval > $this->time_frame + pow(2,($attempts-$this->max_attempts))*$this->login_delay && $attempts > $this->max_attempts){
if($interval > $this->timeframe + pow(2,($attempts-$this->max_attempts))*$this->login_delay && $attempts > $this->max_attempts){
// it's too long ago, reduce at least to allow one more attempt
$attempts = $this->max_attempts;
}
Expand Down

0 comments on commit 1a7b350

Please sign in to comment.