]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Submit.pm
Require a delay of 30 seconds between jobs from a single user
[gruntmaster-page.git] / lib / Gruntmaster / Page / Submit.pm
index 0159a9d06865f7a3f1132324e171bf310a4c748a..569fe9186f38c2cadff58d62af93767f43a4ce61 100644 (file)
@@ -1,15 +1,6 @@
 package Gruntmaster::Page::Submit;
 
-use 5.014000;
-use strict;
-use warnings;
 use Gruntmaster::Page::Base;
-our @ISA = qw/Gruntmaster::Page::Base/;
-our $VERSION = '0.001';
-
-use Apache2::Authen::Passphrase qw/pwcheck pwset USER_REGEX/;
-use File::Slurp qw/read_file/;
-use Plack::Request;
 
 use constant FORMAT_EXTENSION => {
        C => 'c',
@@ -33,6 +24,8 @@ sub generate{
        die if defined $contest && $contest !~ /^\w+$/ ;
        die if defined $contest && (time > contest_end $contest);
        return reply 'A required parameter was not supplied' if grep { !defined } $problem, $format, $prog;
+       return reply 'You must wait 30 seconds between jobs' unless time > lastjob ($r->user) + 30;
+       set_lastjob $r->user;
 
        local $Gruntmaster::Data::contest = $contest if $contest;
 
@@ -61,6 +54,4 @@ sub generate{
        [303, [Location => $r->path =~ s,/pb/\w+/submit$,/log/,r], ['']]
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
This page took 0.021751 seconds and 4 git commands to generate.