mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 00:28:42 +00:00
feat(web/contest): allow admins take part in contests
This commit is contained in:
parent
e411ef91d3
commit
dd417d4f2f
@ -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');
|
||||
}
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user