summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-08 11:35:02 +0200
committerYorhel <git@yorhel.nl>2009-08-08 11:36:40 +0200
commit56e1cdc886144b85ede74c15d1ced116c790f7c2 (patch)
tree814cc652c6c8a3a4ac6d26ca9d6d1769342ddccd /lib
parentd762e3bfb989cb0f95413c37142d18de1180bfbb (diff)
parent1d2756b5fe83419a24591ccc4cc403c3d58dd7af (diff)
Merge branch '3dev' of git://3decibels.net/vndb into beta
+ ChangeLog update
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/DB/Discussions.pm4
-rw-r--r--lib/VNDB/Handler/Discussions.pm4
-rw-r--r--lib/VNDB/Util/FormHTML.pm1
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm
index 58cc5f61..5e371fbc 100644
--- a/lib/VNDB/DB/Discussions.pm
+++ b/lib/VNDB/DB/Discussions.pm
@@ -153,7 +153,7 @@ sub dbThreadCount {
}
-# Options: tid, num, what, order, uid, hide, page, results
+# Options: tid, num, what, order, uid, mindate, hide, page, results
# what: user thread
sub dbPostGet {
my($self, %o) = @_;
@@ -169,6 +169,8 @@ sub dbPostGet {
'tp.num = ?' => $o{num} ) : (),
$o{uid} ? (
'tp.uid = ?' => $o{uid} ) : (),
+ $o{mindate} ? (
+ 'tp.date > ?' => $o{mindate} ) : (),
$o{hide} ? (
'tp.hidden = FALSE' => 1 ) : (),
$o{hide} && $o{what} =~ /thread/ ? (
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index 1ec79c18..d8aa2f63 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -166,6 +166,10 @@ sub edit {
{ name => 'msg', maxlenght => 5000 },
);
+ # check for double-posting
+ push @{$frm->{_err}}, 'doublepost' if $self->dbPostGet(
+ uid => $self->authInfo->{id}, tid => $tid, mindate => time - 30, results => 1, $tid ? () : (num => 1))->[0]{num};
+
# parse and validate the boards
my @boards;
if(!$frm->{_err} && $frm->{boards}) {
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index dfb9a91f..f8047c4c 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -54,6 +54,7 @@ my %formerr_exeptions = (
toolarge => 'Image is too large, only 500kB allowed',
oneaday => 'You can only register one account from the same IP within 24 hours',
nochanges => 'No changes, please don\'t create an entry that is fully -identical- to another',
+ doublepost => 'Please wait 30 seconds before making another post',
);