Bruteforce protection
This commit is contained in:
parent
9280cf3dfe
commit
9d3de43d9e
|
@ -73,6 +73,18 @@ class Security extends dbJSON
|
|||
return true;
|
||||
}
|
||||
|
||||
public function getNumberFailures($ip=null)
|
||||
{
|
||||
if(empty($ip)) {
|
||||
$ip = $this->getUserIp();
|
||||
}
|
||||
|
||||
if(isset($this->db['blackList'][$ip])) {
|
||||
$userBlack = $this->db['blackList'][$ip];
|
||||
return $userBlack['numberFailures'];
|
||||
}
|
||||
}
|
||||
|
||||
public function getUserIp()
|
||||
{
|
||||
// User IP
|
||||
|
|
Loading…
Reference in New Issue