mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-08 14:18:40 +00:00
fix: 90b3675bd5
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
90b3675bd5
commit
ef774d2e97
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
requirePHPLib('form');
|
requirePHPLib('form');
|
||||||
requirePHPLib('judger');
|
requirePHPLib('judger');
|
||||||
|
|
||||||
|
$REQUIRE_LIB['bootstrap5'] = '';
|
||||||
|
|
||||||
if (!Auth::check()) {
|
if (!Auth::check()) {
|
||||||
become403Page(UOJLocale::get('need login'));
|
become403Page(UOJLocale::get('need login'));
|
||||||
@ -18,11 +20,13 @@
|
|||||||
$solution_viewable = hasViewSolutionPermission($problem_extra_config['view_solution_type'], $myUser, $problem);
|
$solution_viewable = hasViewSolutionPermission($problem_extra_config['view_solution_type'], $myUser, $problem);
|
||||||
$solution_submittable = hasViewSolutionPermission($problem_extra_config['submit_solution_type'], $myUser, $problem);
|
$solution_submittable = hasViewSolutionPermission($problem_extra_config['submit_solution_type'], $myUser, $problem);
|
||||||
|
|
||||||
if (!$solution_viewable || isRegisteredRunningContestProblem($myUser, $problem)) {
|
if (!$solution_viewable) {
|
||||||
become403Page();
|
become403Page();
|
||||||
}
|
}
|
||||||
|
|
||||||
$REQUIRE_LIB['bootstrap5'] = '';
|
if (!hasProblemPermission($myUser, $problem) && isRegisteredRunningContestProblem($myUser, $problem)) {
|
||||||
|
become403Page();
|
||||||
|
}
|
||||||
|
|
||||||
function removeSolutionForm($blog_id) {
|
function removeSolutionForm($blog_id) {
|
||||||
$res_form = new UOJForm("remove_solution_{$blog_id}");
|
$res_form = new UOJForm("remove_solution_{$blog_id}");
|
||||||
|
@ -21,10 +21,6 @@
|
|||||||
if (!isNormalUser($myUser)) {
|
if (!isNormalUser($myUser)) {
|
||||||
become403Page();
|
become403Page();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRegisteredRunningContestProblem($myUser, $problem)) {
|
|
||||||
become403Page();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function scoreDistributionData() {
|
function scoreDistributionData() {
|
||||||
|
@ -30,10 +30,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isSubmissionVisibleToUser($submission, $problem, $myUser) || isRegisteredRunningContestProblem($myUser, $problem)) {
|
if (!isSubmissionVisibleToUser($submission, $problem, $myUser)) {
|
||||||
become403Page();
|
become403Page();
|
||||||
}
|
}
|
||||||
|
|
||||||
$out_status = explode(', ', $submission['status'])[0];
|
$out_status = explode(', ', $submission['status'])[0];
|
||||||
|
|
||||||
if ($_GET['get'] == 'status-details' && Auth::check() && $submission['submitter'] === Auth::id()) {
|
if ($_GET['get'] == 'status-details' && Auth::check() && $submission['submitter'] === Auth::id()) {
|
||||||
|
@ -221,12 +221,14 @@ function isHackVisibleToUser($hack, $problem, $user) {
|
|||||||
function isSubmissionFullVisibleToUser($submission, $contest, $problem, $user) {
|
function isSubmissionFullVisibleToUser($submission, $contest, $problem, $user) {
|
||||||
if (isSuperUser($user)) {
|
if (isSuperUser($user)) {
|
||||||
return true;
|
return true;
|
||||||
|
} elseif ($submission['submitter'] == $user['username']) {
|
||||||
|
return true;
|
||||||
|
} elseif (isRegisteredRunningContestProblem($user, $problem)) {
|
||||||
|
return false;
|
||||||
} elseif (!$contest) {
|
} elseif (!$contest) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ($contest['cur_progress'] > CONTEST_IN_PROGRESS) {
|
} elseif ($contest['cur_progress'] > CONTEST_IN_PROGRESS) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ($submission['submitter'] == $user['username']) {
|
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
return hasProblemPermission($user, $problem);
|
return hasProblemPermission($user, $problem);
|
||||||
}
|
}
|
||||||
@ -250,7 +252,7 @@ function isRegisteredRunningContestProblem($user, $problem) {
|
|||||||
while (list($contest_id) = DB::fetch($result, MYSQLI_NUM)) {
|
while (list($contest_id) = DB::fetch($result, MYSQLI_NUM)) {
|
||||||
$contest = queryContest($contest_id);
|
$contest = queryContest($contest_id);
|
||||||
genMoreContestInfo($contest);
|
genMoreContestInfo($contest);
|
||||||
if (CONTEST_NOT_STARTED < $contest['cur_progress'] && $contest['cur_progress'] <= CONTEST_IN_PROGRESS
|
if ($contest['cur_progress'] == CONTEST_IN_PROGRESS
|
||||||
&& hasRegistered($user, $contest)
|
&& hasRegistered($user, $contest)
|
||||||
&& !hasContestPermission($user, $contest)
|
&& !hasContestPermission($user, $contest)
|
||||||
&& queryContestProblemRank($contest, $problem)) {
|
&& queryContestProblemRank($contest, $problem)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user