Block voting and reporting from spam IP #2423

This commit is contained in:
Kijin Sung 2024-11-17 20:43:40 +09:00
parent 737fc40b66
commit a90f444182
2 changed files with 49 additions and 1 deletions

View file

@ -182,6 +182,50 @@ class SpamfilterController extends Spamfilter
return $output;
}
/**
* Block voting from a spam IP.
*/
function triggerVote(&$obj)
{
if ($_SESSION['avoid_log'])
{
return;
}
if ($this->user->isAdmin() || (Context::get('grant')->manager ?? false))
{
return;
}
$output = SpamfilterModel::getInstance()->isDeniedIP();
if (!$output->toBool())
{
return $output;
}
}
/**
* Block reporting from a spam IP.
*/
function triggerDeclare(&$obj)
{
if ($_SESSION['avoid_log'])
{
return;
}
if ($this->user->isAdmin() || (Context::get('grant')->manager ?? false))
{
return;
}
$output = SpamfilterModel::getInstance()->isDeniedIP();
if (!$output->toBool())
{
return $output;
}
}
/**
* @brief The routine process to check the time it takes to store a message, when writing it, and to ban IP/word
*/