. // The form where a moderator decides what he is going to do to a post. // Submits information to forum_moderate_post_action.php for actual action // to be done. require_once('../inc/util.inc'); require_once('../inc/forum.inc'); if (DISABLE_FORUMS) error_page("Forums are disabled"); check_get_args(array("id", "action", "userid", "tnow", "ttok")); $logged_in_user = get_logged_in_user(); check_tokens($logged_in_user->authenticator); BoincForumPrefs::lookup($logged_in_user); $postid = get_int('id'); $post = BoincPost::lookup_id($postid); $thread = BoincThread::lookup_id($post->thread); $forum = BoincForum::lookup_id($thread->forum); if (!get_str('action')) { error_page("No action specified"); } if (!is_moderator($logged_in_user, $forum)) { error_page("You are not authorized to moderate this post."); } page_head(tra("Moderate post")); echo "
id."\" method=\"POST\">\n"; echo form_tokens($logged_in_user->authenticator); start_table(); $get_reason = true; if (get_str('action')=="hide") { //display input that selects reason echo ""; row1(tra("Hide post")); row2(tra("Reason"), ""); } elseif (get_str('action')=="move") { row1(tra("Move post")); echo ""; row2(tra("Destination thread ID:"), ""); // TODO: display where to move the post as a dropdown instead of having to get ID } elseif (get_str('action')=="banish_user") { $userid = get_int('userid'); $user = BoincUser::lookup_id($userid); BoincForumPrefs::lookup($user); if (!$user) { error_page("no user found"); } $x = $user->prefs->banished_until; if ($x>time()) { error_page(tra("User is already banished")); } row1(tra("Banish user")); row1(tra("Are you sure you want to banish %1?
This will prevent %1 from posting for chosen time period.
It should be done only if %1 has consistently exhibited trollish behavior.", $user->name)); row2(tra("Ban duration"), ""); echo "\n"; echo "\n"; echo "\n"; echo "\n"; } elseif (get_str('action')=="delete") { echo ""; row2( "Are you sure want to delete this post? This cannot be undone.", "" ); $get_reason = false; } else { error_page("Unknown action"); } if ($get_reason) { row2(tra("Optional explanation %1 This is included in email to user.%2", "
", ""), "" ); row2( "", "" ); } end_table(); echo "
"; page_tail(); ?>