diff --git a/db/app_uoj233.sql b/db/app_uoj233.sql index ee08e17..397ad22 100644 --- a/db/app_uoj233.sql +++ b/db/app_uoj233.sql @@ -898,7 +898,7 @@ UNLOCK TABLES; CREATE TABLE `user_system_msg` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, - `content` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL, + `content` text COLLATE utf8mb4_unicode_ci NOT NULL, `receiver` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `send_time` datetime NOT NULL, `read_time` datetime DEFAULT NULL, diff --git a/web/app/controllers/subdomain/blog/blog_delete.php b/web/app/controllers/subdomain/blog/blog_delete.php index 121a72c..56ceff3 100644 --- a/web/app/controllers/subdomain/blog/blog_delete.php +++ b/web/app/controllers/subdomain/blog/blog_delete.php @@ -20,7 +20,20 @@ $delete_form = new UOJForm('delete'); $delete_form->handle = function() { - global $blog; + global $myUser, $blog; + + if ($myUser['username'] != $blog['poster']) { + $poster_user_link = getUserLink($blog['poster']); + $admin_user_link = isSuperUser($myUser) ? '管理员' : getUserLink($myUser['username']); + $blog_content = HTML::escape($blog['content_md']); + $content = <<{$poster_user_link} 您好:

+

您的博客 {$blog['title']}(ID:{$blog['id']})已经被 {$admin_user_link} 删除,现将博客原文备份发送给您,请查收。

+
{$blog_content}
+EOD; + sendSystemMsg($blog['poster'], '博客删除通知', $content); + } + deleteBlog($blog['id']); }; $delete_form->submit_button_config['class_str'] = 'btn btn-danger';