X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FPb%2FEntry.pm;h=4cf007edcd1760d3eaf7dea49298ad942d52265f;hb=6cfb28a02398f3759d43998206ab86bc6adfb1f6;hp=95b15a40abf74c3a4f43f084325e3cd9ef200b00;hpb=d0fd48fc9587e9190cb3cde1ee7a2a5db12dbbb6;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Pb/Entry.pm b/lib/Gruntmaster/Page/Pb/Entry.pm index 95b15a4..4cf007e 100644 --- a/lib/Gruntmaster/Page/Pb/Entry.pm +++ b/lib/Gruntmaster/Page/Pb/Entry.pm @@ -12,6 +12,12 @@ use constant FORMATS => [qw/C CPP JAVA PERL PYTHON/]; sub _generate{ my ($self, $htc, $lang, $env, $contest, $id) = @_; debug $env => "language is '$lang', contest is '$contest', id is '$id'"; + my $user = $env->{REMOTE_USER}; + if ($contest && $user && time >= contest_start $contest) { + local $Gruntmaster::Data::contest = $contest; + mark_open $id, $user; + debug $env => "Marking problem $id of contest $contest open by $user"; + } $htc->param(cansubmit => 1); if ($contest) { @@ -27,4 +33,7 @@ sub _generate{ $htc->param(statement => problem_statement $id); } +sub vary { 'Authorization' } +sub max_age { 600 } + 1