X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSubmit.pm;h=e537765165bb64fe05646d9df0bb26a3df098a3e;hb=81cce380bd7f2ab58bb497ef748b7568968ea05d;hp=b08399e005d4f74e0b666aceafcee0e0decb39d1;hpb=3c53f79540e4015db087fd0bfb9b1af9baef1294;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Submit.pm b/lib/Gruntmaster/Page/Submit.pm index b08399e..e537765 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', @@ -27,7 +18,7 @@ sub generate{ my ($problem, $format, $contest, $private, $prog) = map {scalar $r->param($_)} 'problem', 'prog_format', 'contest', 'private', 'source_code'; my $upload = $r->upload('prog'); if (defined $upload) { - my $temp = read_file $upload->filename; + my $temp = read_file $upload->path; $prog = $temp if $temp } die if defined $contest && $contest !~ /^\w+$/ ; @@ -61,6 +52,4 @@ sub generate{ [303, [Location => $r->path =~ s,/pb/\w+/submit$,/log/,r], ['']] } -sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] } - 1