Disallow submissions where the problem does not belong to the contest
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 21 Jan 2015 19:43:36 +0000 (21:43 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 21 Jan 2015 19:43:36 +0000 (21:43 +0200)
lib/Plack/App/Gruntmaster.pm

index ee37a4e3a8ed378fd4b9646acfb2a40384f69390..4f2d6e18f3d9a6d3f11c0dc14ebaab6604c346a9 100644 (file)
@@ -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});
This page took 0.010645 seconds and 4 git commands to generate.