X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSubmit.pm;h=ea67c2b609b3b6c575c86f92e2a7f1014bec367c;hb=e3ab4b036900e0ae2f0b0a39641b2aed82fce8f5;hp=0159a9d06865f7a3f1132324e171bf310a4c748a;hpb=95a9ad1be9a7e32f642d469acb006990c2b86151;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Submit.pm b/lib/Gruntmaster/Page/Submit.pm index 0159a9d..ea67c2b 100644 --- a/lib/Gruntmaster/Page/Submit.pm +++ b/lib/Gruntmaster/Page/Submit.pm @@ -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,9 @@ 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 'Maximum source size is 10KB' if length $prog > 25 * 1024; + 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 +55,4 @@ sub generate{ [303, [Location => $r->path =~ s,/pb/\w+/submit$,/log/,r], ['']] } -sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] } - 1