2005-02-12 09:50:13 +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-15 22:51:05 +00:00
|
|
|
|
2005-02-12 09:50:13 +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);
|
2005-02-12 09:50:13 +00:00
|
|
|
|
2005-02-17 11:43:49 +00:00
|
|
|
if (!get_str('action')) {
|
2008-02-02 17:01:57 +00:00
|
|
|
error_page("no action");
|
2005-02-17 11:43:49 +00:00
|
|
|
}
|
2007-11-12 20:57:15 +00:00
|
|
|
$thread = BoincThread::lookup_id(get_int('thread'));
|
2007-11-15 22:51:05 +00:00
|
|
|
$forum = BoincForum::lookup_id($thread->forum);
|
2005-02-12 09:50:13 +00:00
|
|
|
|
2007-11-15 22:51:05 +00:00
|
|
|
if (!is_moderator($logged_in_user, $forum)) {
|
2008-02-02 17:01:57 +00:00
|
|
|
error_page("not authorized");
|
2005-02-12 09:50:13 +00:00
|
|
|
}
|
|
|
|
|
2008-07-06 22:30:10 +00:00
|
|
|
page_head("Moderate thread '$thread->title'");
|
2005-02-12 09:50:13 +00:00
|
|
|
|
2007-11-12 20:57:15 +00:00
|
|
|
echo "<form action=forum_moderate_thread_action.php?thread=$thread->id method=POST>\n";
|
|
|
|
echo form_tokens($logged_in_user->authenticator);
|
2005-02-12 09:50:13 +00:00
|
|
|
start_table();
|
|
|
|
|
2008-02-02 17:01:57 +00:00
|
|
|
$action = get_str('action');
|
|
|
|
switch ($action) {
|
|
|
|
case 'hide':
|
|
|
|
case 'lock':
|
|
|
|
echo "<input type=hidden name=action value=$action>";
|
2005-02-12 09:50:13 +00:00
|
|
|
row2("",
|
2008-02-02 17:01:57 +00:00
|
|
|
"Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK."
|
|
|
|
);
|
2005-02-12 09:50:13 +00:00
|
|
|
row2("Category",
|
2008-02-02 17:01:57 +00:00
|
|
|
"<select name=\"category\">
|
|
|
|
<option value=\"1\">Obscene</option>
|
|
|
|
<option value=\"2\">Flame/Hate mail</option>
|
|
|
|
<option value=\"3\">Commercial spam</option>
|
|
|
|
<option value=\"4\">Other</option>
|
|
|
|
</select>"
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case 'move':
|
2007-11-15 22:51:05 +00:00
|
|
|
if ($forum->parent_type != 0) error_page("Nope");
|
2005-02-12 09:50:13 +00:00
|
|
|
echo "<input type=hidden name=action value=move>";
|
2007-05-18 14:49:10 +00:00
|
|
|
$selectbox = '<select name="forumid">';
|
2007-11-12 20:57:15 +00:00
|
|
|
$categories = BoincCategory::enum();
|
|
|
|
foreach ($categories as $category) {
|
|
|
|
$forums = BoincForum::enum("category=$category->id");
|
2008-07-06 22:30:10 +00:00
|
|
|
foreach ($forums as $f) {
|
|
|
|
$selectbox .= '<option value="'.$f->id.'">'.$f->title.'</option>';
|
2007-05-18 14:49:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
$selectbox .= '</option>';
|
|
|
|
|
2008-07-06 22:30:10 +00:00
|
|
|
row2("Current forum", $forum->title);
|
|
|
|
row2("Destination forum", $selectbox);
|
2008-02-02 17:01:57 +00:00
|
|
|
break;
|
|
|
|
case 'title':
|
2006-06-16 23:53:56 +00:00
|
|
|
echo "<input type=hidden name=action value=title>";
|
2008-02-02 17:01:57 +00:00
|
|
|
row2("New title:",
|
2008-06-05 20:32:21 +00:00
|
|
|
"<input name=\"newtitle\" value=\"".htmlspecialchars($thread->title)."\">"
|
2008-02-02 17:01:57 +00:00
|
|
|
);
|
|
|
|
break;
|
|
|
|
default:
|
2006-06-16 23:53:56 +00:00
|
|
|
error_page("Unknown action");
|
2005-02-12 09:50:13 +00:00
|
|
|
}
|
|
|
|
|
2008-07-06 22:30:10 +00:00
|
|
|
row2("Reason<br><span class=note>Mailed if nonempty</span>",
|
2008-02-02 17:01:57 +00:00
|
|
|
"<textarea rows=10 cols=80 name=\"reason\"></textarea>"
|
|
|
|
);
|
2005-02-12 09:50:13 +00:00
|
|
|
|
|
|
|
row2(
|
|
|
|
"",
|
|
|
|
"<input type=\"submit\" name=\"submit\" value=\"OK\">"
|
|
|
|
);
|
|
|
|
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|