mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-12-18 02:16:03 +01:00
Merge pull request #690 from Zankaria/simple-antispam
Add simple antispam
This commit is contained in:
commit
032a6f42e3
@ -303,7 +303,14 @@
|
|||||||
'json_response',
|
'json_response',
|
||||||
'user_flag',
|
'user_flag',
|
||||||
'no_country',
|
'no_country',
|
||||||
'tag'
|
'tag',
|
||||||
|
'simple_spam'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Enable simple anti-spam measure.
|
||||||
|
$config['simple_spam'] = array (
|
||||||
|
'question' => 'What is 2 + 3?',
|
||||||
|
'answer' => '5'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
||||||
@ -1158,6 +1165,7 @@
|
|||||||
$config['error']['flood'] = _('Flood detected; Post discarded.');
|
$config['error']['flood'] = _('Flood detected; Post discarded.');
|
||||||
$config['error']['too_many_threads'] = _('The hourly thread limit has been reached. Please post in an existing thread.');
|
$config['error']['too_many_threads'] = _('The hourly thread limit has been reached. Please post in an existing thread.');
|
||||||
$config['error']['spam'] = _('Your request looks automated; Post discarded.');
|
$config['error']['spam'] = _('Your request looks automated; Post discarded.');
|
||||||
|
$config['error']['simple_spam'] = _('You must answer the question to make a new thread. See the last field.');
|
||||||
$config['error']['unoriginal'] = _('Unoriginal content!');
|
$config['error']['unoriginal'] = _('Unoriginal content!');
|
||||||
$config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
|
$config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
|
||||||
$config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
|
$config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
|
||||||
|
5
post.php
5
post.php
@ -558,6 +558,11 @@ if (isset($_POST['delete'])) {
|
|||||||
|
|
||||||
|
|
||||||
if (!$dropped_post) {
|
if (!$dropped_post) {
|
||||||
|
if (isset($config['simple_spam']) && $config['simple_spam'] && $post['op']) {
|
||||||
|
if (!isset($_POST['simple_spam']) || $config['simple_spam']['answer'] != $_POST['simple_spam']) {
|
||||||
|
error($config['error']['simple_spam']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if banned
|
// Check if banned
|
||||||
checkBan($board['uri']);
|
checkBan($board['uri']);
|
||||||
|
@ -215,6 +215,16 @@
|
|||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</td>
|
</td>
|
||||||
</tr>{% endif %}
|
</tr>{% endif %}
|
||||||
|
{% if config.simple_spam and not id %}<tr>
|
||||||
|
<th>
|
||||||
|
{{ config.simple_spam.prompt }}
|
||||||
|
{{ antibot.html() }}
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="simple_spam" value="" size="12" maxlength="18" autocomplete="off">
|
||||||
|
{{ antibot.html() }}
|
||||||
|
</td>
|
||||||
|
</tr>{% endif %}
|
||||||
</table>
|
</table>
|
||||||
{{ antibot.html(true) }}
|
{{ antibot.html(true) }}
|
||||||
<input type="hidden" name="hash" value="{{ antibot.hash() }}">
|
<input type="hidden" name="hash" value="{{ antibot.hash() }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user