From 31f5eb0195bddf2b398394c1b0995ba68a71fbc2 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 21 Jan 2015 21:43:36 +0200 Subject: [PATCH] Disallow submissions where the problem does not belong to the contest --- lib/Plack/App/Gruntmaster.pm | 1 + 1 file changed, 1 insertion(+) 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}); -- 2.39.2