Another commit for rate limiting (must be tired)
This commit is contained in:
parent
6ac6b2ad23
commit
2bc087d7e9
|
@ -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;
|
||||||
|
|
|
@ -179,6 +179,10 @@ if ($type=="post") {
|
||||||
$nemail=$anonym_address;
|
$nemail=$anonym_address;
|
||||||
else
|
else
|
||||||
$nemail=$email;
|
$nemail=$email;
|
||||||
|
$rate_limit = get_user_config($name, 'rate_limit');
|
||||||
|
if(($rate_limit !== FALSE) && ($rate_limit > 0)) {
|
||||||
|
$CONFIG['rate_limit'] = $rate_limit;
|
||||||
|
}
|
||||||
if($CONFIG['rate_limit'] == true && strcmp($name, $CONFIG['anonusername'])) {
|
if($CONFIG['rate_limit'] == true && strcmp($name, $CONFIG['anonusername'])) {
|
||||||
$postsremaining = check_rate_limit($name);
|
$postsremaining = check_rate_limit($name);
|
||||||
if($postsremaining < 1) {
|
if($postsremaining < 1) {
|
||||||
|
|
Loading…
Reference in New Issue