summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-08-22 10:22:13 +0200
committerYorhel <git@yorhel.nl>2011-08-22 10:22:37 +0200
commit341928b722fa6c276ae8c091aebd3f33cc2cbd60 (patch)
tree2818de17974b4ce187771676b79938817e5c5fca
parentaf7dec7a5e74137c6236364bbab6184f1e971954 (diff)
Don't allow regular users to create more than 10 threads a day
This prevents a naive spambot from doing much damage.
-rw-r--r--ChangeLog1
-rw-r--r--data/lang.txt7
-rw-r--r--lib/VNDB/Handler/Discussions.pm5
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 06188156..17e513ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
- JS: Don't consider 256x384 a "bad" screenshot resolution
- Changed location of 'add character/release' links on VN page
- Use generic imgurl() and imgpath() functions to generate image URLs/paths
+ - Don't allow regular users to create more than 10 threads a day
- Bugfix: Properly make i+ IDs linkable in bb2html()
- Bugfix: Make sure the user dropdown boxes work on /v+/chars
- Bugfix: dbTraitGet() filtering would not always work correctly
diff --git a/data/lang.txt b/data/lang.txt
index 3c9d99a3..9c981418 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -8779,6 +8779,13 @@ cs : Před posláním dalšího příspěvku počkejte prosím 30 sekund
hu : Kérlek várj 30 másodpercet mielőtt új hozzászólást küldesz
nl : Wacht a.u.b. 30 seconden voordat je een nieuwe post maakt
+:_formerr_e_threadthrottle
+en : You can only create 10 threads every 24 hours
+ru*:
+cs*:
+hu*:
+nl : Je mag maar 10 topics per 24 uur maken
+
:_formerr_e_badeditsum
en : Please read [url,/d5.4,the guidelines] on how to use the edit summary.
ru : Пожалуйста, прочтите [url,/d5.4,руководство] о том, как использовать поле "Суммарно о правке".
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index 7b4fb2b4..673597ba 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -178,6 +178,11 @@ sub edit {
push @{$frm->{_err}}, 'doublepost' if !$num && !$frm->{_err} && $self->dbPostGet(
uid => $self->authInfo->{id}, tid => $tid, mindate => time - 30, results => 1, $tid ? () : (num => 1))->[0]{num};
+ # Don't allow regular users to create more than 10 threads a day
+ push @{$frm->{_err}}, 'threadthrottle' if
+ !$tid && !$self->authCan('boardmod') &&
+ @{$self->dbPostGet(uid => $self->authInfo->{id}, mindate => time - 24*3600, num => 1)} >= 10;
+
# parse and validate the boards
my @boards;
if(!$frm->{_err} && $frm->{boards}) {