Bruteforce protection

This commit is contained in:
dignajar 2015-08-17 23:18:57 -03:00
parent 9280cf3dfe
commit 9d3de43d9e
1 changed files with 12 additions and 0 deletions

View File

@ -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