S2OJ/web/app/controllers/blog_show.php
Baoshuo 63b7768f78
All checks were successful
continuous-integration/drone/push Build is passing
feat: force-login and open-register config
2022-10-07 17:29:26 +08:00

16 lines
366 B
PHP

<?php
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin();
}
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id']))) {
become404Page();
}
redirectTo(HTML::blog_url($blog['poster'], '/post/'.$_GET['id']));
?>