aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/index.php b/index.php
index 55b12adc..ab51fa23 100644
--- a/index.php
+++ b/index.php
@@ -318,8 +318,17 @@ include $conf->get('resource.ban_file', 'data/ipbans.php');
318function ban_loginFailed($conf) 318function ban_loginFailed($conf)
319{ 319{
320 $ip = $_SERVER['REMOTE_ADDR']; 320 $ip = $_SERVER['REMOTE_ADDR'];
321 $trusted = $conf->get('security.trusted_proxies', array());
322 if (in_array($ip, $trusted)) {
323 $ip = getIpAddressFromProxy($_SERVER, $trusted);
324 if (!$ip) {
325 return;
326 }
327 }
321 $gb = $GLOBALS['IPBANS']; 328 $gb = $GLOBALS['IPBANS'];
322 if (!isset($gb['FAILURES'][$ip])) $gb['FAILURES'][$ip]=0; 329 if (! isset($gb['FAILURES'][$ip])) {
330 $gb['FAILURES'][$ip]=0;
331 }
323 $gb['FAILURES'][$ip]++; 332 $gb['FAILURES'][$ip]++;
324 if ($gb['FAILURES'][$ip] > ($conf->get('security.ban_after') - 1)) 333 if ($gb['FAILURES'][$ip] > ($conf->get('security.ban_after') - 1))
325 { 334 {