projects
/
gruntmaster-handlers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f0ae016
)
Support source_code input
author
Marius Gavrilescu
<marius@ieval.ro>
Mon, 27 Jan 2014 09:20:40 +0000
(11:20 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Mon, 27 Jan 2014 09:20:40 +0000
(11:20 +0200)
lib/Gruntmaster/Handlers.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Gruntmaster/Handlers.pm
b/lib/Gruntmaster/Handlers.pm
index f0281f2826f939da53e258a279818821d7e934b0..41ccfb45ef5d249539bcda8647ef2f5b21e8f844 100644
(file)
--- a/
lib/Gruntmaster/Handlers.pm
+++ b/
lib/Gruntmaster/Handlers.pm
@@
-43,9
+43,13
@@
sub aputs{
sub submit{
my $r = shift;
my $req = Apache2::Request->new($r);
sub submit{
my $r = shift;
my $req = Apache2::Request->new($r);
- my ($problem, $format, $contest, $private) = map {scalar $req->param($_)} 'problem', 'prog_format', 'contest', 'private';
- my $prog;
- $req->upload('prog')->slurp($prog);
+ my ($problem, $format, $contest, $private, $prog) = map {scalar $req->param($_)} 'problem', 'prog_format', 'contest', 'private', 'source_code';
+ my $upload = $req->upload('prog');
+ if (defined $upload) {
+ my $temp;
+ $upload->slurp($temp);
+ $prog = $temp if $temp
+ }
die if defined $contest && $contest !~ /^\w+$/ ;
die if defined $contest && (time < contest_start $contest || time > contest_end $contest);
die if defined $contest && $contest !~ /^\w+$/ ;
die if defined $contest && (time < contest_start $contest || time > contest_end $contest);
This page took
0.009992 seconds
and
4
git commands to generate.