feat(hack): hack success message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-17 10:57:55 +08:00
parent 2ed4d368ce
commit 1f11278815
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 10 additions and 1 deletions

View File

@ -57,6 +57,15 @@ function hackJudged() {
if (!$result['score']) { if (!$result['score']) {
return; return;
} else {
$problem_link = UOJHack::cur()->problem->getLink();
$submission_link = UOJHack::cur()->submission->getLink();
$hacker_link = UOJUser::getLink(UOJHack::info('hacker'), ['color' => false]);
$hack_link = UOJHack::cur()->getLink();
sendSystemMsg(UOJHack::info('owner'), '提交被 Hack 通知', <<<EOD
您对题目 {$problem_link} 的提交 {$submission_link} {$hacker_link} 成功 Hack请查看 Hack {$hack_link} 获取详情。
EOD);
} }
if (!$ok) { if (!$ok) {
return; return;

View File

@ -111,7 +111,7 @@ trait UOJSubmissionLikeTrait {
return $this->info['id']; return $this->info['id'];
} }
public function getLink() { public function getLink() {
return '<a class="text-decoration-none" href="' . $this->getUri() . '">#' . $this->info['id'] . '</a></td>'; return '<a class="text-decoration-none" href="' . HTML::url($this->getUri()) . '">#' . $this->info['id'] . '</a>';
} }
public function getResult($key = null) { public function getResult($key = null) {