sub (/us/:user) { response us_entry => user->name, db->user_entry($_{user}) },
sub (/ct/:contest) { response ct_entry => contest->name, db->contest_entry($_{contest}) },
- sub (/log/:job) { response log_entry => "Job $_{job}", db->job_entry($_{job}) },
+ sub (/log/:job) {
+ forbid job->private;
+ response log_entry => "Job $_{job}", db->job_entry($_{job})
+ },
sub (/pb/:problem + ?contest~) {
my (undef, undef, $contest) = @_;
$_{contest} = $contest;
reply 'Password changed successfully';
},
- sub (/action/submit + %:problem=&:contest~&:prog_format=&:private~&:source_code~ + *:prog~) {
+ sub (/action/submit + %:problem=&:contest~&:prog_format=&:source_code~ + *:prog~) {
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;
unlink $_{prog}->path if $_{prog};
db->jobs->create({
maybe contest => $_{contest},
- maybe private => $_{private},
+ maybe private => problem->private,
date => time,
extension => FORMAT_EXTENSION->{$_{prog_format}},
format => $_{prog_format},