X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSubmit.pm;h=535a5363f8667621bb20a8167efedde0b431fb41;hb=b643b4e844a3d9b9d32dbba977a7cd4181575296;hp=2c9fef0c526cb8d869fd698bd4edbcc9e0abb42e;hpb=16aa291dc49dceda7e612ed7eb2745036790d81c;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page/Submit.pm b/lib/Gruntmaster/Page/Submit.pm index 2c9fef0..535a536 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 > user_lastjob ($r->user) + 30; + set_user_lastjob $r->user, time; local $Gruntmaster::Data::contest = $contest if $contest;