mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Block voting and reporting from spam IP #2423
This commit is contained in:
parent
737fc40b66
commit
a90f444182
2 changed files with 49 additions and 1 deletions
|
|
@ -17,11 +17,15 @@
|
|||
<action name="procSpamfilterAdminInsertConfigCaptcha" type="controller" />
|
||||
</actions>
|
||||
<eventHandlers>
|
||||
<eventHandler before="document.manage" class="controller" method="triggerManageDocument" />
|
||||
<eventHandler before="document.insertDocument" class="controller" method="triggerInsertDocument" />
|
||||
<eventHandler before="document.updateDocument" class="controller" method="triggerInsertDocument" />
|
||||
<eventHandler before="document.manage" class="controller" method="triggerManageDocument" />
|
||||
<eventHandler before="document.updateVotedCount" class="controller" method="triggerVote" />
|
||||
<eventHandler before="document.declaredDocument" class="controller" method="triggerDeclare" />
|
||||
<eventHandler before="comment.insertComment" class="controller" method="triggerInsertComment" />
|
||||
<eventHandler before="comment.updateComment" class="controller" method="triggerInsertComment" />
|
||||
<eventHandler before="comment.updateVotedCount" class="controller" method="triggerVote" />
|
||||
<eventHandler before="comment.declaredComment" class="controller" method="triggerDeclare" />
|
||||
<eventHandler before="communication.sendMessage" class="controller" method="triggerSendMessage" />
|
||||
<eventHandler before="moduleObject.proc" class="controller" method="triggerCheckCaptcha" />
|
||||
</eventHandlers>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue