mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Allow automatically blocking a range of IPs when spam is detected
This commit is contained in:
parent
5cab16418e
commit
aef7f01ed9
4 changed files with 93 additions and 30 deletions
|
|
@ -111,10 +111,20 @@ class spamfilterModel extends spamfilter
|
|||
// Ban the IP address if the interval is exceeded
|
||||
if($count>=$limit_count)
|
||||
{
|
||||
if (\RX_CLIENT_IP_VERSION == 4)
|
||||
{
|
||||
$suffix = $config->ipv4_block_range ?: '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$suffix = $config->ipv6_block_range ?: '';
|
||||
}
|
||||
|
||||
$oSpamFilterController = getController('spamfilter');
|
||||
$oSpamFilterController->insertIP(\RX_CLIENT_IP, 'AUTO-DENIED : Over limit');
|
||||
$oSpamFilterController->insertIP(\RX_CLIENT_IP . $suffix, 'AUTO-DENIED : Over limit');
|
||||
return new Object(-1, 'msg_alert_registered_denied_ip');
|
||||
}
|
||||
|
||||
// If the number of limited posts is not reached, keep creating.
|
||||
if($count)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue