Vergleich moderation.php - 1.8.9 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 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 37Zeile 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 106Zeile 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']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");


}

$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");


$allowable_moderation_actions = array("getip", "getpmip", "cancel_delayedmoderation", "delayedmoderation", "threadnotes", "purgespammer", "viewthreadnotes");


$allowable_moderation_actions = array("getip", "getpmip", "cancel_delayedmoderation", "delayedmoderation", "threadnotes", "purgespammer", "viewthreadnotes");


if($mybb->request_method != "post" && !in_array($mybb->input['action'], $allowable_moderation_actions))

if($mybb->request_method != "post" && !in_array($mybb->input['action'], $allowable_moderation_actions))

{

{

	error_no_permission();
}


	error_no_permission();
}


Zeile 123Zeile 142
{
// Delayed Moderation
case "cancel_delayedmoderation":

{
// Delayed Moderation
case "cancel_delayedmoderation":

		// 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'));


add_breadcrumb($lang->delayed_moderation);
if(!is_moderator($fid, "canmanagethreads"))


add_breadcrumb($lang->delayed_moderation);
if(!is_moderator($fid, "canmanagethreads"))

		{

		{

			error_no_permission();

			error_no_permission();

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');

		}

$plugins->run_hooks('moderation_cancel_delayedmoderation');


$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");

if($tid == 0)
{


$db->delete_query("delayedmoderation", "did='".$mybb->get_input('did', MyBB::INPUT_INT)."'");

if($tid == 0)
{

			moderation_redirect(get_forum_link($fid), $lang->redirect_delayed_moderation_cancelled);
}
else
{

			moderation_redirect(get_forum_link($fid), $lang->redirect_delayed_moderation_cancelled);
}
else
{

			moderation_redirect("moderation.php?action=delayedmoderation&tid={$tid}&my_post_key={$mybb->post_code}", $lang->redirect_delayed_moderation_cancelled);
}
break;

			moderation_redirect("moderation.php?action=delayedmoderation&tid={$tid}&my_post_key={$mybb->post_code}", $lang->redirect_delayed_moderation_cancelled);
}
break;

Zeile 195Zeile 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');





		$mybb->input['type'] = $mybb->get_input('type');

switch($db->type)

		if(is_moderator($fid, "canopenclosethreads"))



		{

		{

			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[] = "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');

if(is_moderator($fid, "canusecustomtools"))

		{

		{

			$allowed_types[] = "modtool_".$tool['tid'];

$tool['name'] = htmlspecialchars_uni($tool['name']);

$checked = "";
if($mybb->input['type'] == "modtool_".$tool['tid'])





			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))

			{

			{

				$checked = "checked=\"checked\"";
}










				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")."\";");



					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 241Zeile 291

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 281Zeile 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 588Zeile 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 600Zeile 695
		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canopenclosethreads"))

		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canopenclosethreads"))

		{

		{

			error_no_permission();
}


			error_no_permission();
}


Zeile 615Zeile 710
			$openclose = $lang->closed;
$redirect = $lang->redirect_closethread;
$moderation->close_threads($tid);

			$openclose = $lang->closed;
$redirect = $lang->redirect_closethread;
$moderation->close_threads($tid);

		}

$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);


		}

$lang->mod_process = $lang->sprintf($lang->mod_process, $openclose);


		log_moderator_action($modlogdata, $lang->mod_process);

moderation_redirect(get_thread_link($thread['tid']), $redirect);

		log_moderator_action($modlogdata, $lang->mod_process);

moderation_redirect(get_thread_link($thread['tid']), $redirect);

Zeile 630Zeile 725
		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canstickunstickthreads"))

		verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canstickunstickthreads"))

		{

		{

			error_no_permission();

			error_no_permission();

		}


		}


		$plugins->run_hooks("moderation_stick");

if($thread['sticky'] == 1)

		$plugins->run_hooks("moderation_stick");

if($thread['sticky'] == 1)

		{

		{

			$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

			$stuckunstuck = $lang->unstuck;
$redirect = $lang->redirect_unstickthread;
$moderation->unstick_threads($tid);

Zeile 647Zeile 742
			$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

			$stuckunstuck = $lang->stuck;
$redirect = $lang->redirect_stickthread;
$moderation->stick_threads($tid);

		}


		}


		$lang->mod_process = $lang->sprintf($lang->mod_process, $stuckunstuck);

log_moderator_action($modlogdata, $lang->mod_process);

		$lang->mod_process = $lang->sprintf($lang->mod_process, $stuckunstuck);

log_moderator_action($modlogdata, $lang->mod_process);





		moderation_redirect(get_thread_link($thread['tid']), $redirect);
break;


		moderation_redirect(get_thread_link($thread['tid']), $redirect);
break;


Zeile 670Zeile 765
		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);

		$plugins->run_hooks("moderation_removeredirects");

$moderation->remove_redirects($tid);





		log_moderator_action($modlogdata, $lang->redirects_removed);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_redirectsremoved);
break;

// Delete thread confirmation page
case "deletethread":

		log_moderator_action($modlogdata, $lang->redirects_removed);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_redirectsremoved);
break;

// Delete thread confirmation page
case "deletethread":





		add_breadcrumb($lang->nav_deletethread);

		add_breadcrumb($lang->nav_deletethread);


if(!is_moderator($fid, "candeletethreads"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])
{
error_no_permission();
}
}

$plugins->run_hooks("moderation_deletethread");

eval("\$deletethread = \"".$templates->get("moderation_deletethread")."\";");
output_page($deletethread);
break;

// Delete the actual thread here
case "do_deletethread":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));



if(!is_moderator($fid, "candeletethreads"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])
{
error_no_permission();
}
}

$plugins->run_hooks("moderation_deletethread");

eval("\$deletethread = \"".$templates->get("moderation_deletethread")."\";");
output_page($deletethread);
break;

// Delete the actual thread here
case "do_deletethread":

// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


		if(!is_moderator($fid, "candeletethreads"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])

		if(!is_moderator($fid, "candeletethreads"))
{
if($permissions['candeletethreads'] != 1 || $mybb->user['uid'] != $thread['uid'])

Zeile 824Zeile 919
		$moderation->unapprove_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadunapproved);

		$moderation->unapprove_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadunapproved);

		break;


		break;


	// Restore a thread
case "restorethread":

	// Restore a thread
case "restorethread":





		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canrestorethreads"))

		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "canrestorethreads"))

		{
error_no_permission();
}
$thread = get_thread($tid);

		{
error_no_permission();
}
$thread = get_thread($tid);


$plugins->run_hooks("moderation_restorethread");


$plugins->run_hooks("moderation_restorethread");





		$lang->thread_restored = $lang->sprintf($lang->thread_restored, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_restored);

$moderation->restore_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadrestored);

		$lang->thread_restored = $lang->sprintf($lang->thread_restored, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_restored);

$moderation->restore_threads($tid);

moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadrestored);

		break;


		break;


	// Soft delete a thread
case "softdeletethread":

	// Soft delete a thread
case "softdeletethread":





		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "cansoftdeletethreads"))

		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if(!is_moderator($fid, "cansoftdeletethreads"))

		{
error_no_permission();

		{
error_no_permission();

		}
$thread = get_thread($tid);

		}
$thread = get_thread($tid);





		$plugins->run_hooks("moderation_softdeletethread");

		$plugins->run_hooks("moderation_softdeletethread");





		$lang->thread_soft_deleted = $lang->sprintf($lang->thread_soft_deleted, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

$moderation->soft_delete_threads($tid);

		$lang->thread_soft_deleted = $lang->sprintf($lang->thread_soft_deleted, $thread['subject']);
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

$moderation->soft_delete_threads($tid);





		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadsoftdeleted);
break;

// Move a thread
case "move":
add_breadcrumb($lang->nav_move);

		moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_threadsoftdeleted);
break;

// Move a thread
case "move":
add_breadcrumb($lang->nav_move);

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();
}

		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();
}


$plugins->run_hooks("moderation_move");



$plugins->run_hooks("moderation_move");


Zeile 895Zeile 990
		$method = $mybb->get_input('method');

if(!is_moderator($fid, "canmanagethreads"))

		$method = $mybb->get_input('method');

if(!is_moderator($fid, "canmanagethreads"))

		{
error_no_permission();

		{
error_no_permission();

		}
// Check if user has moderator permission to move to destination
if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum"))

		}
// Check if user has moderator permission to move to destination
if(!is_moderator($moveto, "canmanagethreads") && !is_moderator($fid, "canmovetononmodforum"))

		{

		{

			error_no_permission();
}
$newperms = forum_permissions($moveto);
if($newperms['canview'] == 0 && !is_moderator($fid, "canmovetononmodforum"))
{

			error_no_permission();
}
$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 1200Zeile 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":


// Let's look up the ip address of a PM
case "getpmip":

Zeile 1239Zeile 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"))
{
error_no_permission();
}

$plugins->run_hooks("moderation_merge");


		if(!is_moderator($fid, "canmanagethreads"))
{
error_no_permission();
}

$plugins->run_hooks("moderation_merge");


		eval("\$merge = \"".$templates->get("moderation_merge")."\";");
output_page($merge);
break;

		eval("\$merge = \"".$templates->get("moderation_merge")."\";");
output_page($merge);
break;

Zeile 1267Zeile 1380
		{
error_no_permission();
}

		{
error_no_permission();
}





		$plugins->run_hooks("moderation_do_merge");

// explode at # sign in a url (indicates a name reference) and reassign to the url

		$plugins->run_hooks("moderation_do_merge");

// explode at # sign in a url (indicates a name reference) and reassign to the url

Zeile 1276Zeile 1389

// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")


// Are we using an SEO URL?
if(substr($mybb->input['threadurl'], -4) == "html")

		{

		{

			// Get thread to merge's tid the SEO way
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);

			// Get thread to merge's tid the SEO way
preg_match("#thread-([0-9]+)?#i", $mybb->input['threadurl'], $threadmatch);
preg_match("#post-([0-9]+)?#i", $mybb->input['threadurl'], $postmatch);

Zeile 1372Zeile 1485
		if($numposts <= 1)
{
error($lang->error_cantsplitonepost);

		if($numposts <= 1)
{
error($lang->error_cantsplitonepost);

		}


		}


		$altbg = "trow1";
$posts = '';
while($post = $db->fetch_array($query))

		$altbg = "trow1";
$posts = '';
while($post = $db->fetch_array($query))

Zeile 1398Zeile 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 1892Zeile 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');

		}

		}

		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck);
break;


		moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsunstuck);
break;


Zeile 1908Zeile 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();
}
}

				error_no_permission();
}
}

Zeile 1930Zeile 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 1943Zeile 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 1953Zeile 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 1964Zeile 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 1998Zeile 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 2019Zeile 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 2048Zeile 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 2066Zeile 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 2086Zeile 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 2165Zeile 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 2175Zeile 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 2191Zeile 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 2206Zeile 2321
	case "multisplitposts":
add_breadcrumb($lang->nav_multi_splitposts);


	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
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
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);
}

$inlineids = implode("|", $posts);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($tid, 'thread');
}
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");


		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
");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))
{
if($tcheck['count'] > 0)
{
$pcheck2[] = $tcheck['tid'];
}
}
if(count($pcheck2) != count($pcheck))
{
// One or more threads do not have posts after splitting
error($lang->error_cantsplitall);
}

$inlineids = implode("|", $posts);
if($mybb->get_input('inlinetype') == 'search')
{
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
}
else
{
clearinline($tid, 'thread');
}
$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");


		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";");

		$return_url = htmlspecialchars_uni($mybb->get_input('url'));

eval("\$splitposts = \"".$templates->get("moderation_inline_splitposts")."\";");

Zeile 2333Zeile 2448
			GROUP BY p.tid, p.pid
");
$pcheck = array();

			GROUP BY p.tid, p.pid
");
$pcheck = array();

		while($tcheck = $db->fetch_array($query))
{

		while($tcheck = $db->fetch_array($query))
{

			if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost);

			if((int)$tcheck['count'] <= 1)
{
error($lang->error_cantsplitonepost);

Zeile 2417Zeile 2532

// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in


// Make sure that we are not moving posts in a thread with one post
// Select number of posts in each thread that the moved post is in

		$query = $db->query("
SELECT DISTINCT p.tid, COUNT(q.pid) as count
FROM ".TABLE_PREFIX."posts p

		$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

			LEFT JOIN ".TABLE_PREFIX."posts q ON (p.tid=q.tid)
WHERE p.pid IN ($pidin)
GROUP BY p.tid, p.pid

Zeile 2476Zeile 2591

// 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'));

 

$plugins->run_hooks("moderation_do_multimoveposts");


// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));


// explode at # sign in a url (indicates a name reference) and reassign to the url
$realurl = explode("#", $mybb->get_input('threadurl'));

Zeile 2805Zeile 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 2960Zeile 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')
{