diff --git a/web/app/controllers/contest_registration.php b/web/app/controllers/contest_registration.php index c15fd1e..6f96e71 100644 --- a/web/app/controllers/contest_registration.php +++ b/web/app/controllers/contest_registration.php @@ -13,7 +13,7 @@ if (!Auth::check()) { redirectToLogin(); - } elseif (hasContestPermission($myUser, $contest) || hasRegistered($myUser, $contest) || $contest['cur_progress'] != CONTEST_NOT_STARTED) { + } elseif (hasRegistered($myUser, $contest) || $contest['cur_progress'] != CONTEST_NOT_STARTED) { redirectTo('/contests'); } diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php index 2c3ed19..9d2c554 100644 --- a/web/app/controllers/problem.php +++ b/web/app/controllers/problem.php @@ -39,6 +39,11 @@ } else { $ban_in_contest = !isProblemVisibleToUser($problem, $myUser); } + } else { + if ($contest['cur_progress'] == CONTEST_IN_PROGRESS) { + $is_in_contest = true; + DB::update("update contests_registrants set has_participated = 1 where username = '{$myUser['username']}' and contest_id = {$contest['id']}"); + } } } else { if (!isProblemVisibleToUser($problem, $myUser)) {