S2OJ/web/app/controllers/subdomain/blog/slide.php
Baoshuo c5bb4a1a67
All checks were successful
continuous-integration/drone/push Build is passing
feat: redirect to login instead of return 403
2022-10-06 20:28:43 +08:00

20 lines
528 B
PHP

<?php
requirePHPLib('form');
if (!Auth::check()) {
redirectToLogin();
}
if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHisSlide($blog)) {
become404Page();
}
if ($blog['is_hidden'] && !UOJContext::hasBlogPermission()) {
become403Page();
}
$page_config = UOJContext::pageConfig();
$page_config['PageTitle'] = HTML::stripTags($blog['title']) . ' - 幻灯片';
$page_config['content'] = $blog['content'];
uojIncludeView('slide', $page_config);
?>