sort output of blocked list by block timestamp

This commit is contained in:
Brian Quinion
2012-12-08 17:58:24 +00:00
parent a723b94291
commit 02e7cfd6f4
2 changed files with 16 additions and 5 deletions

View File

@@ -17,6 +17,12 @@
(defined('CONST_ConnectionBucket_PageType')?constant('CONST_ConnectionBucket_Cost_'.CONST_ConnectionBucket_PageType):1) + user_busy_cost(),
CONST_ConnectionBucket_LeakRate, CONST_ConnectionBucket_BlockLimit);
if ($fBucketVal > CONST_ConnectionBucket_WaitLimit && $fBucketVal < CONST_ConnectionBucket_BlockLimit)
{
sleep(($fBucketVal - CONST_ConnectionBucket_WaitLimit)/CONST_ConnectionBucket_LeakRate);
$fBucketVal = doBucket($aBucketKeys, 0, 0, CONST_ConnectionBucket_BlockLimit);
}
if (strpos(CONST_BlockedIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false || $fBucketVal >= CONST_ConnectionBucket_BlockLimit)
{
echo "Your IP has been blocked. \n";
@@ -25,9 +31,4 @@
exit;
}
if ($fBucketVal > CONST_ConnectionBucket_WaitLimit)
{
sleep(($fBucketVal - CONST_ConnectionBucket_WaitLimit)/CONST_ConnectionBucket_LeakRate);
}
header('Content-type: text/html; charset=utf-8');