2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
|
|
|
requirePHPLib('form');
|
2022-03-17 04:00:03 +00:00
|
|
|
|
2022-10-08 06:10:14 +00:00
|
|
|
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
2022-10-06 12:28:43 +00:00
|
|
|
redirectToLogin();
|
2022-03-17 04:00:03 +00:00
|
|
|
}
|
2022-10-08 06:10:14 +00:00
|
|
|
|
|
|
|
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
|
|
|
|
become403Page();
|
|
|
|
}
|
2016-07-18 16:39:37 +00:00
|
|
|
|
|
|
|
if (!UOJContext::hasBlogPermission()) {
|
|
|
|
become403Page();
|
|
|
|
}
|
|
|
|
if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHis($blog)) {
|
|
|
|
become404Page();
|
|
|
|
}
|
|
|
|
|
|
|
|
$delete_form = new UOJForm('delete');
|
|
|
|
$delete_form->handle = function() {
|
|
|
|
global $blog;
|
|
|
|
deleteBlog($blog['id']);
|
|
|
|
};
|
|
|
|
$delete_form->submit_button_config['class_str'] = 'btn btn-danger';
|
|
|
|
$delete_form->submit_button_config['text'] = '是的,我确定要删除';
|
|
|
|
$delete_form->succ_href = "/archive";
|
|
|
|
|
|
|
|
$delete_form->runAtServer();
|
2022-09-18 04:58:35 +00:00
|
|
|
?>
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php echoUOJPageHeader('删除博客 - ' . HTML::stripTags($blog['title'])) ?>
|
|
|
|
<h3>您真的要删除博客 <?= $blog['title'] ?> 吗?该操作不可逆!</h3>
|
|
|
|
<?php $delete_form->printHTML(); ?>
|
|
|
|
<?php echoUOJPageFooter() ?>
|