From: Marius Gavrilescu Date: Tue, 25 Mar 2014 07:43:56 +0000 (+0200) Subject: Fix require_admin again X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=31f640df51b00846b1970d00e0d496deaff25da5;p=gruntmaster-page.git Fix require_admin again --- diff --git a/app.psgi b/app.psgi index a661a31..0222a16 100644 --- a/app.psgi +++ b/app.psgi @@ -45,9 +45,9 @@ sub is_problem_private { sub admin_required { local $_ = $_[0]; my $env = $_[1]; - return $db->contest($1)->owner->id if $env->{'gruntmaster.contest'} && db->contest($env->{'gruntmaster.contest'})->start > time; + return $db->contest($1)->owner->id if $env->{'gruntmaster.contest'} && $db->contest($env->{'gruntmaster.contest'})->start > time; return $db->problem($1)->owner->id if m,^/pb/$word, && is_problem_private $1 || $env->{'gruntmaster.problem'} && is_problem_private $env->{'gruntmaster.problem'}; - return $db->job ($1)->owner->id if m,^/log/(?:src/)?$word, && ($db->job($1)->private || is_problem_private $db->job($1)->problem || $db->job($1)->contest && $db->contest($db->job($1)->contest)->start > time); + return $db->job ($1)->owner->id if m,^/log/(?:src/)?$word, && ($db->job($1)->private || is_problem_private $db->job($1)->problem->id || $db->job($1)->contest && $db->contest($db->job($1)->contest)->start > time); '' }