2005-01-18 13:00:38 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
// The form where a moderator decides what he is going to do to a post.
|
|
|
|
// Submits informaiton to forum_moderate_post_action.php for actual action
|
|
|
|
// to be done.
|
2005-01-18 13:00:38 +00:00
|
|
|
|
|
|
|
require_once('../inc/forum.inc');
|
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
$logged_in_user = get_logged_in_user();
|
|
|
|
BoincForumPrefs::lookup($logged_in_user);
|
2007-11-15 22:51:05 +00:00
|
|
|
$postid = get_int('id');
|
|
|
|
$post = BoincPost::lookup_id($postid);
|
|
|
|
$thread = BoincThread::lookup_id($post->thread);
|
|
|
|
$forum = BoincForum::lookup_id($thread->forum);
|
2005-01-18 13:00:38 +00:00
|
|
|
|
2006-06-16 23:53:56 +00:00
|
|
|
if (!get_str('action')) {
|
2007-11-15 22:51:05 +00:00
|
|
|
error_page("No action specified");
|
2005-01-18 13:00:38 +00:00
|
|
|
}
|
2007-11-15 22:51:05 +00:00
|
|
|
if (!is_moderator($logged_in_user, $forum)) {
|
2006-06-16 23:53:56 +00:00
|
|
|
error_page("You are not authorized to moderate this post.");
|
|
|
|
}
|
|
|
|
|
2007-11-28 17:40:28 +00:00
|
|
|
page_head('Moderate post');
|
2005-01-18 13:00:38 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
echo "<form action=\"forum_moderate_post_action.php?id=".$post->id."\" method=\"POST\">\n";
|
|
|
|
echo form_tokens($logged_in_user->authenticator);
|
2005-01-18 13:00:38 +00:00
|
|
|
start_table();
|
|
|
|
|
2005-02-17 11:43:49 +00:00
|
|
|
if (get_str('action')=="hide") {
|
2005-01-18 13:00:38 +00:00
|
|
|
//display input that selects reason
|
|
|
|
echo "<input type=hidden name=action value=hide>";
|
2007-11-28 17:40:28 +00:00
|
|
|
row1("Hide post");
|
|
|
|
row2("Reason",
|
2005-01-18 13:00:38 +00:00
|
|
|
"<select name=\"category\">
|
2005-02-13 21:33:02 +00:00
|
|
|
<option value=\"1\">Obscene</option>
|
|
|
|
<option value=\"2\">Flame/Hate mail</option>
|
|
|
|
<option value=\"3\">Commercial spam</option>
|
|
|
|
<option value=\"4\">Doublepost</option>
|
2006-09-13 15:52:53 +00:00
|
|
|
<option value=\"5\">User Request</option>
|
|
|
|
<option value=\"6\">Other</option>
|
2005-01-18 13:00:38 +00:00
|
|
|
</select>");
|
2005-02-17 11:43:49 +00:00
|
|
|
} elseif (get_str('action')=="move") {
|
2007-11-28 17:40:28 +00:00
|
|
|
row1("Move post");
|
2005-01-18 13:00:38 +00:00
|
|
|
echo "<input type=hidden name=action value=move>";
|
|
|
|
row2("Destination thread ID:", "<input name=\"threadid\">");
|
2006-06-16 23:53:56 +00:00
|
|
|
//todo display where to move the post as a dropdown instead of having to get ID
|
2006-08-08 20:32:37 +00:00
|
|
|
} elseif (get_str('action')=="banish_user") {
|
|
|
|
$userid = get_int('userid');
|
2007-11-12 20:57:15 +00:00
|
|
|
$user = BoincUser::lookup_id($userid);
|
|
|
|
BoincForumPrefs::lookup($user);
|
2006-08-08 20:32:37 +00:00
|
|
|
if (!$user) {
|
|
|
|
error_page("no user");
|
|
|
|
}
|
2007-11-12 20:57:15 +00:00
|
|
|
$x = $user->prefs->banished_until;
|
2006-08-08 20:32:37 +00:00
|
|
|
if ($x>time()) {
|
2007-03-24 14:57:30 +00:00
|
|
|
error_page("User is already banished");
|
2006-08-08 20:32:37 +00:00
|
|
|
}
|
2007-11-28 17:40:28 +00:00
|
|
|
row1("Banish user");
|
2007-11-12 20:57:15 +00:00
|
|
|
row1("Are you sure you want to banish ".$user->name."?
|
|
|
|
This will prevent ".$user->name." from posting for chosen time period.<br />
|
|
|
|
It should be done only if ".$user->name."
|
2007-03-24 14:57:30 +00:00
|
|
|
has consistently exhibited trollish behavior.");
|
|
|
|
row2("Ban duration", "<select name=\"duration\">
|
|
|
|
<option value=\"14400\">4 hours</option>
|
|
|
|
<option value=\"86400\">1 day</option>
|
|
|
|
<option value=\"604800\">1 week</option>
|
|
|
|
<option value=\"1209600\" selected=\"selected\">2 weeks</option>
|
|
|
|
<option value=\"2592000\">1 month</option>
|
|
|
|
<option value=\"-1\">Forever</option>
|
|
|
|
</select>");
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"banish_user\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"id\" value=\"".$postid."\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"userid\" value=\"".$userid."\">\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"confirmed\" value=\"yes\">\n";
|
2005-01-18 13:00:38 +00:00
|
|
|
} else {
|
2006-06-16 23:53:56 +00:00
|
|
|
error_page( "Unknown action");
|
2005-01-18 13:00:38 +00:00
|
|
|
}
|
|
|
|
|
2007-11-28 17:40:28 +00:00
|
|
|
row2("Optional explanation
|
|
|
|
<br><span class=note>This is included in email to user</span>",
|
2007-03-24 14:57:30 +00:00
|
|
|
"<textarea name=\"reason\" rows=\"10\" cols=\"80\"></textarea>");
|
2005-01-18 13:00:38 +00:00
|
|
|
|
|
|
|
row2(
|
|
|
|
"",
|
2007-11-28 17:40:28 +00:00
|
|
|
"<input type=\"submit\" name=\"submit\" value=\"OK\">"
|
2005-01-18 13:00:38 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|