admin can edit post now

This commit is contained in:
Tony Yang 2019-06-02 03:29:09 +08:00
parent fda4ffbbce
commit 47b238a233
Signed by: t510599
GPG Key ID: D88388851C28715D

View File

@ -277,15 +277,15 @@ if (isset($_GET['pid'])) {
exit;
}
if ($post->author != $user->username) {
if ($post->author != $user->username && $user->level < 8) {
http_response_code(403);
header('Location: post.php?err=edit');
exit;
}
}
$title = $post->title;
$content = $post->content;
$title = $post->title;
$content = $post->content;
}
$view = new View('theme/default.html', 'theme/nav/util.php', 'theme/sidebar.php', $blog['name'], ($title == "" ? "文章" : $title));