Zeile 11 | Zeile 11 |
---|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'moderation.php');
|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'moderation.php');
|
$templatelist = "changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move"; $templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer"; $templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_getpmip";
| $templatelist = "changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move,moderation_threadnotes"; $templatelist .= ",moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_mergeposts_post,moderation_viewthreadnotes,moderation_confirmation,moderation_purgespammer,forumjump_bit"; $templatelist .= ",moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_getip_modoptions,moderation_getip,moderation_getpmip,moderation_getpmip_modal";
|
$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error"; $templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error"; $templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";
|
$templatelist .= ",moderation_split_post,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts,moderation_threadnotes_modaction_error"; $templatelist .= ",moderation_inline_splitposts,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password,moderation_inline_moveposts,moderation_delayedmodaction_error"; $templatelist .= ",moderation_delayedmodaction_notes_thread_single,moderation_delayedmodaction_notes_thread_multiple,moderation_delayedmodaction_notes_forum,moderation_delayedmodaction_notes_new_forum";
|
$templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,forumjump_bit";
| $templatelist .= ",moderation_delayedmodaction_notes_redirect,moderation_delayedmodaction_notes_merge,moderation_delayedmoderation_thread,moderation_threadnotes_modaction_thread,moderation_getip_modal";
|
$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";
|
$templatelist .= ",moderation_delayedmoderation_date_day,moderation_delayedmoderation_date_month,moderation_threadnotes_modaction_post,moderation_merge,moderation_split,moderation_threadnotes_modaction_forum";
|
| $templatelist .= ",moderation_delayedmoderation_openclose,moderation_delayedmoderation_softdeleterestore,moderation_delayedmoderation_delete,moderation_delayedmoderation_stick,moderation_delayedmoderation_approve";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 37 | Zeile 38 |
---|
$pid = $mybb->get_input('pid', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT); $pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
|
$pid = $mybb->get_input('pid', MyBB::INPUT_INT); $fid = $mybb->get_input('fid', MyBB::INPUT_INT); $pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
|
| $modal = $mybb->get_input('modal', MyBB::INPUT_INT);
|
if($pid) {
| if($pid) {
|
Zeile 106 | Zeile 108 |
---|
{ // Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
{ // Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
| }
$log_multithreads_actions = array("do_multideletethreads", "multiclosethreads", "multiopenthreads", "multiapprovethreads", "multiunapprovethreads", "multirestorethreads", "multisoftdeletethreads","multistickthreads", "multiunstickthreads", "do_multimovethreads"); if(in_array($mybb->input['action'], $log_multithreads_actions)) { if(!empty($mybb->input['searchid'])) { $tids = getids($mybb->get_input('searchid'), 'search'); } else { $tids = getids($fid, 'forum'); }
$modlogdata['tids'] = (array)$tids;
unset($tids);
|
}
$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
| }
$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
|
Zeile 195 | Zeile 214 |
---|
$errors = array(); $customthreadtools = "";
|
$errors = array(); $customthreadtools = "";
|
$allowed_types = array('openclosethread', 'softdeleterestorethread', 'deletethread', 'move', 'stick', 'merge', 'removeredirects', 'removesubscriptions', 'approveunapprovethread');
| $allowed_types = array('move', 'merge', 'removeredirects', 'removesubscriptions');
if(is_moderator($fid, "canopenclosethreads")) { $allowed_types[] = "openclosethread"; }
if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads")) { $allowed_types[] = "softdeleterestorethread"; }
if(is_moderator($fid, "candeletethreads")) { $allowed_types[] = "deletethread"; }
if(is_moderator($fid, "canstickunstickthreads")) { $allowed_types[] = "stick"; }
if(is_moderator($fid, "canapproveunapprovethreads")) { $allowed_types[] = "approveunapprovethread"; }
|
$mybb->input['type'] = $mybb->get_input('type');
|
$mybb->input['type'] = $mybb->get_input('type');
|
switch($db->type) { case "pgsql": case "sqlite": $query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'"); break; default: $query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'"); } while($tool = $db->fetch_array($query)) { $allowed_types[] = "modtool_".$tool['tid'];
$tool['name'] = htmlspecialchars_uni($tool['name']);
$checked = ""; if($mybb->input['type'] == "modtool_".$tool['tid']) { $checked = "checked=\"checked\""; }
eval("\$customthreadtools .= \"".$templates->get("moderation_delayedmoderation_custommodtool")."\";");
| if(is_moderator($fid, "canusecustomtools")) { switch($db->type) { case "pgsql": case "sqlite": $query = $db->simple_select("modtools", 'tid, name, groups', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'"); break; default: $query = $db->simple_select("modtools", 'tid, name, groups', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'"); } while($tool = $db->fetch_array($query)) { if(is_member($tool['groups'])) { $allowed_types[] = "modtool_".$tool['tid'];
$tool['name'] = htmlspecialchars_uni($tool['name']);
$checked = ""; if($mybb->input['type'] == "modtool_".$tool['tid']) { $checked = "checked=\"checked\""; }
eval("\$customthreadtools .= \"".$templates->get("moderation_delayedmoderation_custommodtool")."\";"); } }
|
}
$mybb->input['delayedmoderation'] = $mybb->get_input('delayedmoderation', MyBB::INPUT_ARRAY);
| }
$mybb->input['delayedmoderation'] = $mybb->get_input('delayedmoderation', MyBB::INPUT_ARRAY);
|
Zeile 228 | Zeile 278 |
---|
if($mybb->input['action'] == "do_delayedmoderation" && $mybb->request_method == "post") { if(!in_array($mybb->input['type'], $allowed_types))
|
if($mybb->input['action'] == "do_delayedmoderation" && $mybb->request_method == "post") { if(!in_array($mybb->input['type'], $allowed_types))
|
{
| {
|
$mybb->input['type'] = ''; $errors[] = $lang->error_delayedmoderation_unsupported_type; }
| $mybb->input['type'] = ''; $errors[] = $lang->error_delayedmoderation_unsupported_type; }
|
Zeile 238 | Zeile 288 |
---|
$mybb->input['delayedmoderation']['method'] = ''; $errors[] = $lang->error_delayedmoderation_unsupported_method; }
|
$mybb->input['delayedmoderation']['method'] = ''; $errors[] = $lang->error_delayedmoderation_unsupported_method; }
|
|
|
if($mybb->input['type'] == 'move') {
|
if($mybb->input['type'] == 'move') {
|
$newforum = get_forum($fid);
| $newfid = (int)$mybb->input['delayedmoderation']['new_forum'];
// Make sure moderator has permission to move to the new forum $newperms = forum_permissions($newfid); if($newperms['canview'] == 0 || !is_moderator($newfid, 'canmovetononmodforum')) { $errors[] = $lang->error_movetononmodforum; }
$newforum = get_forum($newfid);
|
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
|
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
|
{
| {
|
$errors[] = $lang->error_invalidforum;
|
$errors[] = $lang->error_invalidforum;
|
| }
$method = $mybb->input['delayedmoderation']['method']; if($method != "copy" && $fid == $newfid) { $errors[] = $lang->error_movetosameforum;
|
} }
| } }
|
Zeile 281 | Zeile 346 |
---|
{ if(is_array($mybb->input['tids'])) {
|
{ if(is_array($mybb->input['tids'])) {
|
$mybb->input['tids'] = implode(',' , $mybb->input['tids']);
| $mybb->input['tids'] = implode(',', $mybb->input['tids']);
|
}
$did = $db->insert_query("delayedmoderation", array(
| }
$did = $db->insert_query("delayedmoderation", array(
|
Zeile 293 | Zeile 358 |
---|
'dateline' => TIME_NOW, 'inputs' => $db->escape_string(my_serialize($mybb->input['delayedmoderation'])) ));
|
'dateline' => TIME_NOW, 'inputs' => $db->escape_string(my_serialize($mybb->input['delayedmoderation'])) ));
|
|
|
$plugins->run_hooks('moderation_do_delayedmoderation');
$rundate_format = my_date('relative', $rundate, '', 2);
| $plugins->run_hooks('moderation_do_delayedmoderation');
$rundate_format = my_date('relative', $rundate, '', 2);
|
Zeile 471 | Zeile 536 |
---|
while($delayedmod = $db->fetch_array($query)) { $delayedmod['dateline'] = my_date("jS M Y, {$mybb->settings['timeformat']}", $delayedmod['delaydateline']);
|
while($delayedmod = $db->fetch_array($query)) { $delayedmod['dateline'] = my_date("jS M Y, {$mybb->settings['timeformat']}", $delayedmod['delaydateline']);
|
$delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
| $delayedmod['username'] = htmlspecialchars_uni($delayedmod['username']);
|
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']]; $info = ''; if(strpos($delayedmod['tids'], ',') === false)
|
$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']); $delayedmod['action'] = $actions[$delayedmod['type']]; $info = ''; if(strpos($delayedmod['tids'], ',') === false)
|
{
| {
|
$delayed_thread = get_thread($delayedmod['tids']); $delayed_thread['link'] = get_thread_link($delayed_thread['tid']); $delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject'])); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");
|
$delayed_thread = get_thread($delayedmod['tids']); $delayed_thread['link'] = get_thread_link($delayed_thread['tid']); $delayed_thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($delayed_thread['subject'])); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_single")."\";");
|
}
| }
|
else { eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_multiple")."\";");
|
else { eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_thread_multiple")."\";");
|
}
| }
|
if($delayedmod['fname'])
|
if($delayedmod['fname'])
|
{
| {
|
$delayedmod['link'] = get_forum_link($delayedmod['fid']); $delayedmod['fname'] = htmlspecialchars_uni($delayedmod['fname']); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_forum")."\";");
| $delayedmod['link'] = get_forum_link($delayedmod['fid']); $delayedmod['fname'] = htmlspecialchars_uni($delayedmod['fname']); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_forum")."\";");
|
Zeile 500 | Zeile 565 |
---|
$delayedmod['link'] = get_forum_link($delayedmod['inputs']['new_forum']); $delayedmod['name'] = htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name']); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_new_forum")."\";");
|
$delayedmod['link'] = get_forum_link($delayedmod['inputs']['new_forum']); $delayedmod['name'] = htmlspecialchars_uni($forum_cache[$delayedmod['inputs']['new_forum']]['name']); eval("\$info .= \"".$templates->get("moderation_delayedmodaction_notes_new_forum")."\";");
|
|
|
if($delayedmod['inputs']['method'] == "redirect") { if((int)$delayedmod['inputs']['redirect_expire'] == 0)
| if($delayedmod['inputs']['method'] == "redirect") { if((int)$delayedmod['inputs']['redirect_expire'] == 0)
|
Zeile 529 | Zeile 594 |
---|
{ $cols = 5; eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");
|
{ $cols = 5; eval("\$delayedmods = \"".$templates->get("moderation_delayedmodaction_error")."\";");
|
}
| }
|
$url = ''; if($mybb->get_input('tid', MyBB::INPUT_INT))
| $url = ''; if($mybb->get_input('tid', MyBB::INPUT_INT))
|
Zeile 588 | Zeile 653 |
---|
$dateyear = gmdate('Y', TIME_NOW + $localized_time_offset); $datetime = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);
|
$dateyear = gmdate('Y', TIME_NOW + $localized_time_offset); $datetime = gmdate($mybb->settings['timeformat'], TIME_NOW + $localized_time_offset);
|
| $openclosethread = ''; if(is_moderator($fid, "canopenclosethreads")) { eval('$openclosethread = "'.$templates->get('moderation_delayedmoderation_openclose').'";'); }
$softdeleterestorethread = ''; if(is_moderator($fid, "cansoftdeletethreads") || is_moderator($fid, "canrestorethreads")) { eval('$softdeleterestorethread = "'.$templates->get('moderation_delayedmoderation_softdeleterestore').'";'); }
$deletethread = ''; if(is_moderator($fid, "candeletethreads")) { eval('$deletethread = "'.$templates->get('moderation_delayedmoderation_delete').'";'); }
$stickunstickthread = ''; if(is_moderator($fid, "canstickunstickthreads")) { eval('$stickunstickthread = "'.$templates->get('moderation_delayedmoderation_stick').'";'); }
$approveunapprovethread = ''; if(is_moderator($fid, "canapproveunapprovethreads")) { eval('$approveunapprovethread = "'.$templates->get('moderation_delayedmoderation_approve').'";'); }
|
$plugins->run_hooks("moderation_delayedmoderation");
| $plugins->run_hooks("moderation_delayedmoderation");
|
Zeile 906 | Zeile 1001 |
---|
$newperms = forum_permissions($moveto); if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum")) {
|
$newperms = forum_permissions($moveto); if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum")) {
|
error_no_permission();
| error($lang->error_movetononmodforum);
|
}
$newforum = get_forum($moveto);
| }
$newforum = get_forum($moveto);
|
Zeile 1200 | Zeile 1295 |
---|
$plugins->run_hooks('moderation_getip');
|
$plugins->run_hooks('moderation_getip');
|
eval("\$getip = \"".$templates->get("moderation_getip")."\";"); output_page($getip); break;
| if($modal) { eval("\$getip = \"".$templates->get("moderation_getip_modal", 1, 0)."\";"); echo $getip; exit; } else { eval("\$getip = \"".$templates->get("moderation_getip")."\";"); output_page($getip); break; }
|
// Let's look up the ip address of a PM case "getpmip": if($pmid <= 0)
|
// Let's look up the ip address of a PM case "getpmip": if($pmid <= 0)
|
{
| {
|
error($lang->error_invalidpm); } add_breadcrumb($lang->nav_pms, "private.php");
| error($lang->error_invalidpm); } add_breadcrumb($lang->nav_pms, "private.php");
|
Zeile 1217 | Zeile 1321 |
---|
if(!$mybb->usergroup['issupermod']) { error_no_permission();
|
if(!$mybb->usergroup['issupermod']) { error_no_permission();
|
}
| }
|
$pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress'])); $hostname = @gethostbyaddr($pm['ipaddress']); if(!$hostname || $hostname == $pm['ipaddress'])
| $pm['ipaddress'] = my_inet_ntop($db->unescape_binary($pm['ipaddress'])); $hostname = @gethostbyaddr($pm['ipaddress']); if(!$hostname || $hostname == $pm['ipaddress'])
|
Zeile 1228 | Zeile 1332 |
---|
$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username'); $username = build_profile_link($name, $pm['fromid']);
|
$name = $db->fetch_field($db->simple_select('users', 'username', "uid = {$pm['fromid']}"), 'username'); $username = build_profile_link($name, $pm['fromid']);
|
|
|
// Moderator options $modoptions = ""; if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)
| // Moderator options $modoptions = ""; if($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canuseipsearch'] == 1)
|
Zeile 1239 | Zeile 1343 |
---|
$plugins->run_hooks('moderation_getpmip');
|
$plugins->run_hooks('moderation_getpmip');
|
eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";"); output_page($getpmip); break;
| if($modal) { eval("\$getpmip = \"".$templates->get("moderation_getpmip_modal", 1, 0)."\";"); echo $getpmip; exit; } else { eval("\$getpmip = \"".$templates->get("moderation_getpmip")."\";"); output_page($getpmip); break; }
|
// Merge threads case "merge": add_breadcrumb($lang->nav_merge);
|
// Merge threads case "merge": add_breadcrumb($lang->nav_merge);
|
if(!is_moderator($fid, "canmanagethreads"))
| if(!is_moderator($fid, "canmanagethreads"))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 1370 | Zeile 1483 |
---|
"); $numposts = $db->num_rows($query); if($numposts <= 1)
|
"); $numposts = $db->num_rows($query); if($numposts <= 1)
|
{ error($lang->error_cantsplitonepost); }
| { error($lang->error_cantsplitonepost); }
|
$altbg = "trow1"; $posts = '';
| $altbg = "trow1"; $posts = '';
|
Zeile 1398 | Zeile 1511 |
---|
eval("\$posts .= \"".$templates->get("moderation_split_post")."\";"); $altbg = alt_trow(); }
|
eval("\$posts .= \"".$templates->get("moderation_split_post")."\";"); $altbg = alt_trow(); }
|
| clearinline($tid, 'thread');
|
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");
$plugins->run_hooks("moderation_split");
| $forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");
$plugins->run_hooks("moderation_split");
|
Zeile 1408 | Zeile 1523 |
---|
// Let's break them up buddy! (Do the split) case "do_split":
|
// Let's break them up buddy! (Do the split) case "do_split":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!is_moderator($fid, "canmanagethreads")) { error_no_permission();
|
}
$plugins->run_hooks("moderation_do_split");
| }
$plugins->run_hooks("moderation_do_split");
|
Zeile 1540 | Zeile 1655 |
---|
$threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, "candeletethreads"))
|
$threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, "candeletethreads"))
|
{
| {
|
error_no_permission(); } foreach($threadlist as $tid)
| error_no_permission(); } foreach($threadlist as $tid)
|
Zeile 1553 | Zeile 1668 |
---|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
} else {
| } else {
|
clearinline($fid, 'forum'); } mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted); break;
|
clearinline($fid, 'forum'); } mark_reports($tlist, "threads"); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsdeleted); break;
|
|
|
// Open threads - Inline moderation case "multiopenthreads":
|
// Open threads - Inline moderation case "multiopenthreads":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); }
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canopenclosethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads')) { error_no_permission(); }
|
}
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
| }
|
$moderation->open_threads($threads);
| $moderation->open_threads($threads);
|
Zeile 1624 | Zeile 1739 |
---|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canopenclosethreads'))
|
{ error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
| { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
|
$moderation->close_threads($threads);
log_moderator_action($modlogdata, $lang->multi_closed_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
$moderation->close_threads($threads);
log_moderator_action($modlogdata, $lang->multi_closed_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
} else {
| } else {
|
clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed); break;
// Approve threads - Inline moderation
|
clearinline($fid, 'forum'); } moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsclosed); break;
// Approve threads - Inline moderation
|
case "multiapprovethreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canapproveunapprovethreads')) { error_no_permission(); } } if(count($threads) < 1) {
| case "multiapprovethreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canapproveunapprovethreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canapproveunapprovethreads')) { error_no_permission(); } } if(count($threads) < 1) {
|
error($lang->error_inline_nothreadsselected); }
| error($lang->error_inline_nothreadsselected); }
|
Zeile 1681 | Zeile 1796 |
---|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
} else
| } else
|
{ clearinline($fid, 'forum'); }
| { clearinline($fid, 'forum'); }
|
Zeile 1709 | Zeile 1824 |
---|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canapproveunapprovethreads'))
|
{ $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canapproveunapprovethreads'))
|
{ error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
| { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected);
|
}
|
}
|
|
|
$moderation->unapprove_threads($threads, $fid);
|
$moderation->unapprove_threads($threads, $fid);
|
|
|
log_moderator_action($modlogdata, $lang->multi_unapproved_threads);
|
log_moderator_action($modlogdata, $lang->multi_unapproved_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
|
{ clearinline($fid, 'forum'); }
| { clearinline($fid, 'forum'); }
|
Zeile 1735 | Zeile 1850 |
---|
// Restore threads - Inline moderation case "multirestorethreads":
|
// Restore threads - Inline moderation case "multirestorethreads":
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 1748 | Zeile 1863 |
---|
error_no_permission(); } }
|
error_no_permission(); } }
|
else
| else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canrestorethreads')) { error_no_permission(); } } if(count($threads) < 1)
|
{
|
{
|
$threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canrestorethreads')) { error_no_permission(); } } if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
$moderation->restore_threads($threads);
| error($lang->error_inline_nothreadsselected); }
$moderation->restore_threads($threads);
|
log_moderator_action($modlogdata, $lang->multi_restored_threads);
|
log_moderator_action($modlogdata, $lang->multi_restored_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
|
{ clearinline($fid, 'forum'); }
| { clearinline($fid, 'forum'); }
|
Zeile 1777 | Zeile 1892 |
---|
break;
// Soft delete threads - Inline moderation
|
break;
// Soft delete threads - Inline moderation
|
case "multisoftdeletethreads":
| case "multisoftdeletethreads":
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 1791 | Zeile 1906 |
---|
error_no_permission(); } }
|
error_no_permission(); } }
|
else
| else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'cansoftdeletethreads')) { error_no_permission(); } } if(count($threads) < 1)
|
{
|
{
|
$threads = getids($fid, 'forum'); if(!is_moderator($fid, 'cansoftdeletethreads'))
| error($lang->error_inline_nothreadsselected); }
$moderation->soft_delete_threads($threads);
log_moderator_action($modlogdata, $lang->multi_soft_deleted_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($fid, 'forum'); } $cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted); break;
// Stick threads - Inline moderation case "multistickthreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canstickunstickthreads'))
|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
}
| }
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
|
if(count($threads) < 1) { error($lang->error_inline_nothreadsselected); }
|
$moderation->soft_delete_threads($threads);
log_moderator_action($modlogdata, $lang->multi_soft_deleted_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($fid, 'forum'); } $cache->update_stats(); moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadssoftdeleted); break;
// Stick threads - Inline moderation case "multistickthreads":
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if(!empty($mybb->input['searchid'])) { // From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads')) { error_no_permission(); } } else { $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canstickunstickthreads')) { error_no_permission(); } } if(count($threads) < 1)
| $moderation->stick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_stuck_threads); if($mybb->get_input('inlinetype') == 'search')
|
{
|
{
|
error($lang->error_inline_nothreadsselected); }
$moderation->stick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_stuck_threads); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
| clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
} else {
| } else {
|
Zeile 1872 | Zeile 1987 |
---|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canstickunstickthreads'))
|
{ error_no_permission(); } }
| { error_no_permission(); } }
|
else { $threads = getids($fid, 'forum');
| else { $threads = getids($fid, 'forum');
|
Zeile 1892 | Zeile 2007 |
---|
$moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
|
$moderation->unstick_threads($threads);
log_moderator_action($modlogdata, $lang->multi_unstuck_threads);
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); }
| if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); }
|
else { clearinline($fid, 'forum');
| else { clearinline($fid, 'forum');
|
Zeile 1908 | Zeile 2023 |
---|
add_breadcrumb($lang->nav_multi_movethreads);
if(!empty($mybb->input['searchid']))
|
add_breadcrumb($lang->nav_multi_movethreads);
if(!empty($mybb->input['searchid']))
|
{
| {
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
// From search page $threads = getids($mybb->get_input('searchid'), 'search'); if(!is_moderator_by_tids($threads, 'canmanagethreads'))
|
{
| {
|
error_no_permission(); } } else
|
error_no_permission(); } } else
|
{
| {
|
$threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads')) {
| $threads = getids($fid, 'forum'); if(!is_moderator($fid, 'canmanagethreads')) {
|
Zeile 1930 | Zeile 2045 |
---|
error($lang->error_inline_nothreadsselected); } $inlineids = implode("|", $threads);
|
error($lang->error_inline_nothreadsselected); } $inlineids = implode("|", $threads);
|
if($mybb->get_input('inlinetype') == 'search') {
| if($mybb->get_input('inlinetype') == 'search') {
|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
|
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else
|
{
| {
|
clearinline($fid, 'forum'); } $forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");
| clearinline($fid, 'forum'); } $forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");
|
Zeile 1943 | Zeile 2058 |
---|
eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";"); output_page($movethread); break;
|
eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";"); output_page($movethread); break;
|
|
|
// Actually move the threads in Inline moderation case "do_multimovethreads":
| // Actually move the threads in Inline moderation case "do_multimovethreads":
|
Zeile 1953 | Zeile 2068 |
---|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); $threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
|
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); $threadlist = explode("|", $mybb->get_input('threads')); if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
foreach($threadlist as $tid) { $tids[] = (int)$tid;
| foreach($threadlist as $tid) { $tids[] = (int)$tid;
|
Zeile 1964 | Zeile 2079 |
---|
$newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum')) {
|
$newperms = forum_permissions($moveto); if(($newperms['canview'] == 0 || !is_moderator($moveto, 'canmanagethreads')) && !is_moderator_by_tids($tids, 'canmovetononmodforum')) {
|
error_no_permission();
| error($lang->error_movetononmodforum);
|
}
$newforum = get_forum($moveto);
| }
$newforum = get_forum($moveto);
|
Zeile 1998 | Zeile 2113 |
---|
error($lang->error_inline_nopostsselected); } if(!is_moderator_by_pids($posts, "candeleteposts"))
|
error($lang->error_inline_nopostsselected); } if(!is_moderator_by_pids($posts, "candeleteposts"))
|
{ error_no_permission(); } $inlineids = implode("|", $posts); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($tid, 'thread'); }
| { error_no_permission(); } $inlineids = implode("|", $posts); if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); } else { clearinline($tid, 'thread'); }
|
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
| $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
Zeile 2019 | Zeile 2134 |
---|
// Actually delete the posts in inline moderation case "do_multideleteposts":
|
// Actually delete the posts in inline moderation case "do_multideleteposts":
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 2048 | Zeile 2163 |
---|
$moderation->delete_post($pid); $plist[] = $pid; $deletecount++;
|
$moderation->delete_post($pid); $plist[] = $pid; $deletecount++;
|
}
| }
|
// If we have multiple threads, we must be coming from the search if(!empty($tids))
|
// If we have multiple threads, we must be coming from the search if(!empty($tids))
|
{
| {
|
foreach($tids as $tid)
|
foreach($tids as $tid)
|
{ $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
| { $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
|
} } // Otherwise we're just deleting from showthread.php
| } } // Otherwise we're just deleting from showthread.php
|
Zeile 2066 | Zeile 2181 |
---|
$query = $db->simple_select("posts", "pid", "tid = $tid"); $numposts = $db->num_rows($query); if(!$numposts)
|
$query = $db->simple_select("posts", "pid", "tid = $tid"); $numposts = $db->num_rows($query); if(!$numposts)
|
{
| {
|
$moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
| $moderation->delete_thread($tid); mark_reports($tid, "thread"); $url = get_forum_link($fid);
|
Zeile 2086 | Zeile 2201 |
---|
// Merge posts - Inline moderation case "multimergeposts": add_breadcrumb($lang->nav_multi_mergeposts);
|
// Merge posts - Inline moderation case "multimergeposts": add_breadcrumb($lang->nav_multi_mergeposts);
|
if($mybb->get_input('inlinetype') == 'search')
| if($mybb->get_input('inlinetype') == 'search')
|
{ $posts = getids($mybb->get_input('searchid'), 'search'); }
| { $posts = getids($mybb->get_input('searchid'), 'search'); }
|
Zeile 2165 | Zeile 2280 |
---|
else { clearinline($tid, 'thread');
|
else { clearinline($tid, 'thread');
|
}
| }
|
$return_url = htmlspecialchars_uni($mybb->get_input('url'));
| $return_url = htmlspecialchars_uni($mybb->get_input('url'));
|
Zeile 2175 | Zeile 2290 |
---|
// Actually merge the posts - Inline moderation case "do_multimergeposts":
|
// Actually merge the posts - Inline moderation case "do_multimergeposts":
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
Zeile 2191 | Zeile 2306 |
---|
}
if(!is_moderator_by_pids($postlist, "canmanagethreads"))
|
}
if(!is_moderator_by_pids($postlist, "canmanagethreads"))
|
{ error_no_permission(); }
$masterpid = $moderation->merge_posts($postlist, $tid, $mybb->input['sep']);
| { error_no_permission(); }
$masterpid = $moderation->merge_posts($postlist, $tid, $mybb->input['sep']);
|
mark_reports($postlist, "posts"); log_moderator_action($modlogdata, $lang->merged_selective_posts);
| mark_reports($postlist, "posts"); log_moderator_action($modlogdata, $lang->merged_selective_posts);
|
Zeile 2205 | Zeile 2320 |
---|
// Split posts - Inline moderation case "multisplitposts": add_breadcrumb($lang->nav_multi_splitposts);
|
// Split posts - Inline moderation case "multisplitposts": add_breadcrumb($lang->nav_multi_splitposts);
|
if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search'); } else { $posts = getids($tid, 'thread'); }
if(count($posts) < 1) { error($lang->error_inline_nopostsselected); }
if(!is_moderator_by_pids($posts, "canmanagethreads")) { error_no_permission(); } $posts = array_map('intval', $posts); $pidin = implode(',', $posts);
// Make sure that we are not splitting a thread with one post // Select number of posts in each thread that the splitted post is in $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid) WHERE p.pid IN ($pidin) GROUP BY p.tid, p.pid "); $threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1) { error($lang->error_cantsplitonepost); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
// Make sure that we are not splitting all posts in the thread // The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal) $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count FROM ".TABLE_PREFIX."posts p
| if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search'); } else { $posts = getids($tid, 'thread'); }
if(count($posts) < 1) { error($lang->error_inline_nopostsselected); }
if(!is_moderator_by_pids($posts, "canmanagethreads")) { error_no_permission(); } $posts = array_map('intval', $posts); $pidin = implode(',', $posts);
// Make sure that we are not splitting a thread with one post // Select number of posts in each thread that the splitted post is in $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid) WHERE p.pid IN ($pidin) GROUP BY p.tid, p.pid "); $threads = $pcheck = array(); while($tcheck = $db->fetch_array($query)) { if((int)$tcheck['count'] <= 1) { error($lang->error_cantsplitonepost); } $threads[] = $pcheck[] = $tcheck['tid']; // Save tids for below }
// Make sure that we are not splitting all posts in the thread // The query does not return a row when the count is 0, so find if some threads are missing (i.e. 0 posts after removal) $query = $db->query(" SELECT DISTINCT p.tid, COUNT(q.pid) as count FROM ".TABLE_PREFIX."posts p
|
LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin) GROUP BY p.tid, p.pid
| LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid) WHERE p.pid IN ($pidin) AND q.pid NOT IN ($pidin) GROUP BY p.tid, p.pid
|
Zeile 2807 | Zeile 2922 |
---|
require_once MYBB_ROOT."inc/functions_user.php";
$groups = explode(",", $mybb->settings['purgespammergroups']);
|
require_once MYBB_ROOT."inc/functions_user.php";
$groups = explode(",", $mybb->settings['purgespammergroups']);
|
if(!in_array($mybb->user['usergroup'], $groups))
| if(!is_member($groups))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 2962 | Zeile 3077 |
---|
output_page($page); exit; }
|
output_page($page); exit; }
|
| $tool['name'] = htmlspecialchars_uni($tool['name']);
|
if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread') {
| if($tool['type'] == 't' && $mybb->get_input('modtype') == 'inlinethread') {
|