projects
/
gruntmaster-page.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
12dd934
)
Require authentication and privacy for problems during contests
author
Marius Gavrilescu
<marius@ieval.ro>
Wed, 21 Jan 2015 19:24:26 +0000
(21:24 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 21 Jan 2015 19:24:26 +0000
(21:24 +0200)
lib/Plack/App/Gruntmaster.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster.pm
b/lib/Plack/App/Gruntmaster.pm
index 9775b960c10d729d96c7984f5661dcf8f6e99073..136f657028192cd05399dd61c3118ef92109928d 100644
(file)
--- a/
lib/Plack/App/Gruntmaster.pm
+++ b/
lib/Plack/App/Gruntmaster.pm
@@
-179,6
+179,10
@@
sub dispatch_request{
$_{contest} = $contest;
return NOT_FOUND if !contest && !problem->is_in_archive || contest && !db->contest_problems->find($_{contest}, $_{problem});
forbid problem->is_private;
+ if (contest && contest->is_running) {
+ forbid !remote_user;
+ $privacy = 'private';
+ }
response pb_entry => problem->name, db->problem_entry($_{problem}, $_{contest}, remote_user && remote_user->id);
},
sub (/sol/:problem) {
This page took
0.010311 seconds
and
4
git commands to generate.