From f5e972c030675f46cda543e13da1b787457e070b Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Wed, 23 Jun 2021 15:21:12 -0600 Subject: Add the rest of the changes --- moderate.php | 108 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 29 deletions(-) mode change 100644 => 100755 moderate.php (limited to 'moderate.php') diff --git a/moderate.php b/moderate.php old mode 100644 new mode 100755 index 68bf1b9..5a181ac --- a/moderate.php +++ b/moderate.php @@ -1,29 +1,79 @@ -get_current_user(); - - if ($user->level == USER_LEVEL_MODERATOR) { - if (strcasecmp($delete, "on") == 0) { - $thread = new Thread(); - $thread->get_from_database($thread_id); - delete_thread($thread); - - header("Location: /"); - exit(); - } - } - - header("Location: viewthread.php?id=$thread_id"); - exit(); -} - -header("Location: /"); \ No newline at end of file +get_current_user(); + + if (Session::get()->is_signed_in() and $user->level == USER_LEVEL_MODERATOR) { + // Set the value of these again with the variables from the POST request + $is_post = strcasecmp($type, "post") == 0; + $is_thread = strcasecmp($type, "thread") == 0; + + if (strcasecmp($type, "thread") == 0) { + $thread = new Thread($id); + if (strcasecmp($action, "delete") == 0) Thread::delete($thread); + } else if (strcasecmp($type, "post") == 0) { + $post = new Post($id); + if (strcasecmp($action, "delete") == 0) $post->delete(); + } + } +} else { + +} +?> + + + + cflip.net forum Moderation + + + + +is_signed_in() and $user->level == USER_LEVEL_MODERATOR): ?> + +

Moderate post

+get_content(); ?> +
+ + + + +
+ +

Moderate thread

+

subject ?>

+
+ + + + + + +
+ + +
You must be signed in as a moderator to access this page.
+ + + \ No newline at end of file -- cgit v1.2.3