2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
|
|
|
|
2022-10-07 09:29:26 +00:00
|
|
|
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
2022-10-06 12:28:43 +00:00
|
|
|
redirectToLogin();
|
2016-07-18 16:39:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_array($_GET['get'])) {
|
|
|
|
become404Page();
|
|
|
|
}
|
|
|
|
|
|
|
|
$res = [];
|
|
|
|
|
|
|
|
foreach ($_GET['get'] as $id) {
|
|
|
|
if (!validateUInt($id)) {
|
|
|
|
become404Page();
|
|
|
|
}
|
|
|
|
$submission = querySubmission($id);
|
|
|
|
if ($submission['submitter'] !== Auth::id()) {
|
|
|
|
become403Page();
|
|
|
|
}
|
2022-10-07 09:29:26 +00:00
|
|
|
if ($submission['contest_id'] == null && !(isNormalUser($myUser) && UOJConfig::$data['switch']['force-login'])) {
|
2022-04-03 10:18:17 +00:00
|
|
|
become403Page();
|
|
|
|
}
|
2016-07-18 16:39:37 +00:00
|
|
|
|
|
|
|
$problem = queryProblemBrief($submission['problem_id']);
|
|
|
|
if (!isSubmissionVisibleToUser($submission, $problem, Auth::user())) {
|
|
|
|
become403Page();
|
|
|
|
}
|
|
|
|
|
|
|
|
$out_status = explode(', ', $submission['status'])[0];
|
|
|
|
|
|
|
|
$res[] = [
|
|
|
|
'judged' => $out_status == 'Judged',
|
|
|
|
'html' => getSubmissionStatusDetails($submission)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
die(json_encode($res));
|