Proper commit for adding rate limiting per user
This commit is contained in:
parent
39c1b00908
commit
3c9435a07a
@ -165,6 +165,10 @@ function check_rate_limit($name,$set=0,$gettime=0) {
|
|||||||
fclose($ratefp);
|
fclose($ratefp);
|
||||||
$postqty=$postqty+1;
|
$postqty=$postqty+1;
|
||||||
}
|
}
|
||||||
|
$rate_limit = get_user_config($name, 'rate_limit');
|
||||||
|
if(($rate_limit !== FALSE) && ($rate_limit > 0)) {
|
||||||
|
$CONFIG['rate_limit'] = $rate_limit;
|
||||||
|
}
|
||||||
$postsremaining = $CONFIG['rate_limit']-$postqty;
|
$postsremaining = $CONFIG['rate_limit']-$postqty;
|
||||||
if($gettime) {
|
if($gettime) {
|
||||||
$wait=(3600-(time()-$oldest))/60;
|
$wait=(3600-(time()-$oldest))/60;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user