From 9d3de43d9ee7089e2e17f0fcf743a145acf3aa8d Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 17 Aug 2015 23:18:57 -0300 Subject: [PATCH] Bruteforce protection --- kernel/security.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/security.class.php b/kernel/security.class.php index 7fe3be21..3761a1e4 100644 --- a/kernel/security.class.php +++ b/kernel/security.class.php @@ -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