From: Marius Gavrilescu Date: Wed, 21 Jan 2015 19:43:36 +0000 (+0200) Subject: Disallow submissions where the problem does not belong to the contest X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=31f5eb0195bddf2b398394c1b0995ba68a71fbc2;p=gruntmaster-page.git Disallow submissions where the problem does not belong to the contest --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index ee37a4e..4f2d6e1 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -221,6 +221,7 @@ sub dispatch_request{ forbid !remote_user; return reply 'This contest has finished' if contest && contest->is_finished; return reply 'This contest has not yet started' if !admin && contest && contest->is_pending; + return reply 'This problem does not belong to this contest' if !contest && !problem->is_in_archive || contest && !db->contest_problems->find($_{contest}, $_{problem}); return reply 'Maximum source size is 10KB' if ($prog ? $prog->size : length $_{source_code}) > 10 * 1024; return reply 'You must wait 30 seconds between jobs' if !admin && time <= remote_user->lastjob + 30; remote_user->update({lastjob => time});