Vergleich moderation.php - 1.4.3 - 1.4.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: moderation.php 4176 2008-09-03 13:50:09Z Tikitiki $

 * $Id: moderation.php 5379 2011-02-21 11:06:42Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 95Zeile 95
else
{
eval("\$loginbox = \"".$templates->get("loginbox")."\";");

else
{
eval("\$loginbox = \"".$templates->get("loginbox")."\";");

 
}

if($mybb->request_method != "post" && $mybb->input['action'] != "getip")
{
error_no_permission();

}

// Begin!

}

// Begin!

Zeile 164Zeile 169

// Remove redirects to a specific thread
case "removeredirects":


// Remove redirects to a specific thread
case "removeredirects":


// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);



// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


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

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

		{

		{

			error_no_permission();
}

$plugins->run_hooks("moderation_removeredirects");

			error_no_permission();
}

$plugins->run_hooks("moderation_removeredirects");





		$moderation->remove_redirects($tid);

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

		$moderation->remove_redirects($tid);

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

Zeile 185Zeile 190
	case "deletethread":

add_breadcrumb($lang->nav_deletethread);

	case "deletethread":

add_breadcrumb($lang->nav_deletethread);


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


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

		}

$plugins->run_hooks("moderation_deletethread");

		}

$plugins->run_hooks("moderation_deletethread");

Zeile 232Zeile 237
	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);

	// Delete the poll from a thread confirmation page
case "deletepoll":
add_breadcrumb($lang->nav_deletepoll);


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



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


		$plugins->run_hooks("moderation_deletepoll");

$query = $db->simple_select("polls", "*", "tid='$tid'");

		$plugins->run_hooks("moderation_deletepoll");

$query = $db->simple_select("polls", "*", "tid='$tid'");

Zeile 253Zeile 258
		eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);
break;

		eval("\$deletepoll = \"".$templates->get("moderation_deletepoll")."\";");
output_page($deletepoll);
break;





	// Delete the actual poll here!
case "do_deletepoll":

	// Delete the actual poll here!
case "do_deletepoll":





		// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


		// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 265Zeile 270
			error($lang->redirect_pollnotdeleted);
}
if(!is_moderator($fid, "candeleteposts"))

			error($lang->redirect_pollnotdeleted);
}
if(!is_moderator($fid, "candeleteposts"))

		{

		{

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

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

Zeile 277Zeile 282
		{
error($lang->error_invalidpoll);
}

		{
error($lang->error_invalidpoll);
}





		$plugins->run_hooks("moderation_do_deletepoll");

$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);

		$plugins->run_hooks("moderation_do_deletepoll");

$lang->poll_deleted = $lang->sprintf($lang->poll_deleted, $thread['subject']);

Zeile 290Zeile 295

// Approve a thread
case "approvethread":


// Approve a thread
case "approvethread":


// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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


// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 307Zeile 312
		log_moderator_action($modlogdata, $lang->thread_approved);

$moderation->approve_threads($tid, $fid);

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

$moderation->approve_threads($tid, $fid);





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

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





	// Unapprove a thread
case "unapprovethread":

	// Unapprove a thread
case "unapprovethread":





		// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

		// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

		{
error_no_permission();
}

		{
error_no_permission();
}

		$query = $db->simple_select("threads", "*", "tid='$tid'");
$thread = $db->fetch_array($query);

$plugins->run_hooks("moderation_unapprovethread");

		$query = $db->simple_select("threads", "*", "tid='$tid'");
$thread = $db->fetch_array($query);

$plugins->run_hooks("moderation_unapprovethread");





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


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


Zeile 337Zeile 342
	// Delete selective posts in a thread
case "deleteposts":
add_breadcrumb($lang->nav_deleteposts);

	// Delete selective posts in a thread
case "deleteposts":
add_breadcrumb($lang->nav_deleteposts);

		if(!is_moderator($fid, "candeleteposts"))
{
error_no_permission();
}
$posts = "";
$query = $db->query("
SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p

		if(!is_moderator($fid, "candeleteposts"))
{
error_no_permission();
}
$posts = "";
$query = $db->query("
SELECT p.*, u.*
FROM ".TABLE_PREFIX."posts p

			LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'
ORDER BY dateline ASC

			LEFT JOIN ".TABLE_PREFIX."users u ON (p.uid=u.uid)
WHERE tid='$tid'
ORDER BY dateline ASC

Zeile 393Zeile 398

$deletethread = "1";
$deletepost = $mybb->input['deletepost'];


$deletethread = "1";
$deletepost = $mybb->input['deletepost'];

		$query = $db->simple_select("posts", "*", "tid='$tid'");

		$query = $db->simple_select("posts", "*", "tid='$tid'");

		while($post = $db->fetch_array($query))
{
if($deletepost[$post['pid']] == 1)

		while($post = $db->fetch_array($query))
{
if($deletepost[$post['pid']] == 1)

Zeile 487Zeile 492
		}

foreach($mergepost as $pid => $yes)

		}

foreach($mergepost as $pid => $yes)

		{
$plist[] = intval($pid);
}
$moderation->merge_posts($plist, $tid, $mybb->input['sep']);


		{
$plist[] = intval($pid);
}
$moderation->merge_posts($plist, $tid, $mybb->input['sep']);


		mark_reports($plist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_mergeposts);

		mark_reports($plist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_mergeposts);

		break;

		break;


// Move a thread
case "move":


// Move a thread
case "move":

Zeile 504Zeile 509
		{
error_no_permission();
}

		{
error_no_permission();
}





		$plugins->run_hooks("moderation_move");


		$plugins->run_hooks("moderation_move");


		$forumselect = build_forum_jump("", '', 1, '', 0, '', "moveto");

		$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");

		eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);
break;

// Lets get this thing moving!

		eval("\$movethread = \"".$templates->get("moderation_move")."\";");
output_page($movethread);
break;

// Lets get this thing moving!

	case "do_move":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	case "do_move":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


		$moveto = intval($mybb->input['moveto']);
$method = $mybb->input['method'];


		$moveto = intval($mybb->input['moveto']);
$method = $mybb->input['method'];


Zeile 616Zeile 621
		if(!$modactions)
{
$modactions = "<tr><td class=\"trow1\" colspan=\"4\">$lang->no_mod_options</td></tr>";

		if(!$modactions)
{
$modactions = "<tr><td class=\"trow1\" colspan=\"4\">$lang->no_mod_options</td></tr>";

		}

		}


$plugins->run_hooks("moderation_threadnotes");



$plugins->run_hooks("moderation_threadnotes");


Zeile 664Zeile 669
		if($mybb->usergroup['canmodcp'] == 1)
{
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		if($mybb->usergroup['canmodcp'] == 1)
{
eval("\$modoptions = \"".$templates->get("moderation_getip_modoptions")."\";");

		}


		}


		eval("\$getip = \"".$templates->get("moderation_getip")."\";");
output_page($getip);

		eval("\$getip = \"".$templates->get("moderation_getip")."\";");
output_page($getip);

		break;


		break;


	// Merge threads
case "merge":
add_breadcrumb($lang->nav_merge);

	// Merge threads
case "merge":
add_breadcrumb($lang->nav_merge);

Zeile 677Zeile 682
		{
error_no_permission();
}

		{
error_no_permission();
}





		$plugins->run_hooks("moderation_merge");

		$plugins->run_hooks("moderation_merge");





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

// Lets get those threads together baby! (Merge threads)

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

// Lets get those threads together baby! (Merge threads)

	case "do_merge":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	case "do_merge":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


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

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

Zeile 822Zeile 827
			eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();
}

			eval("\$posts .= \"".$templates->get("moderation_split_post")."\";");
$altbg = alt_trow();
}

		$forumselect = build_forum_jump("", $fid, 1, '', 0, '', "moveto");

		$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");


$plugins->run_hooks("moderation_split");



$plugins->run_hooks("moderation_split");


Zeile 1058Zeile 1063
		break;

// Approve threads - Inline moderation

		break;

// Approve threads - Inline moderation

	case "multiapprovethreads":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canmanagethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canmanagethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);
}


	case "multiapprovethreads":

// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

if(!empty($mybb->input['searchid']))
{
// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canmanagethreads'))
{
error_no_permission();
}
}
else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canmanagethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);
}


		$moderation->approve_threads($threads, $fid);

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

		$moderation->approve_threads($threads, $fid);

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

Zeile 1262Zeile 1267
		{
clearinline($fid, 'forum');
}

		{
clearinline($fid, 'forum');
}

		$forumselect = build_forum_jump("", '', 1, '', 0, '', "moveto");

		$forumselect = build_forum_jump("", '', 1, '', 0, true, '', "moveto");

		$return_url = htmlspecialchars_uni($mybb->input['url']);
eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";");
output_page($movethread);

		$return_url = htmlspecialchars_uni($mybb->input['url']);
eval("\$movethread = \"".$templates->get("moderation_inline_movethreads")."\";");
output_page($movethread);

Zeile 1352Zeile 1357
		{
error_no_permission();
}

		{
error_no_permission();
}

 
		$postlist = array_map('intval', $postlist);
$pids = implode(',', $postlist);

$tids = array();
if($pids)
{
$query = $db->simple_select("threads", "tid", "firstpost IN({$pids})");
while($threadid = $db->fetch_field($query, "tid"))
{
$tids[] = $threadid;
}
}


		$deletecount = 0;
foreach($postlist as $pid)

		$deletecount = 0;
foreach($postlist as $pid)

		{

		{

			$pid = intval($pid);
$moderation->delete_post($pid);
$plist[] = $pid;
$deletecount++;

			$pid = intval($pid);
$moderation->delete_post($pid);
$plist[] = $pid;
$deletecount++;

		}
$query = $db->simple_select("posts", "*", "tid='$tid'");
$numposts = $db->num_rows($query);
if(!$numposts)
{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);
}





		}

// If we have multiple threads, we must be coming from the search
if(!empty($tids))
{
foreach($tids as $tid)
{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);
}
}
// Otherwise we're just deleting from showthread.php

		else
{

		else
{

			mark_reports($plist, "posts");
$url = get_thread_link($thread['tid']);












			$query = $db->simple_select("posts", "*", "tid='$tid'");
$numposts = $db->num_rows($query);
if(!$numposts)
{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");
$url = get_forum_link($fid);
}
else
{
mark_reports($plist, "posts");
$url = get_thread_link($thread['tid']);
}

		}

		}

 
		

		$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount);
log_moderator_action($modlogdata, $lang->deleted_selective_posts);
moderation_redirect($url, $lang->redirect_postsdeleted);

		$lang->deleted_selective_posts = $lang->sprintf($lang->deleted_selective_posts, $deletecount);
log_moderator_action($modlogdata, $lang->deleted_selective_posts);
moderation_redirect($url, $lang->redirect_postsdeleted);

Zeile 1381Zeile 1415
	// 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->input['inlinetype'] == 'search')
{
$posts = getids($mybb->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();

		
if($mybb->input['inlinetype'] == 'search')
{
$posts = getids($mybb->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();

		}
$inlineids = implode("|", $posts);
if($mybb->input['inlinetype'] == 'search')

		}
$inlineids = implode("|", $posts);
if($mybb->input['inlinetype'] == 'search')

Zeile 1423Zeile 1457
		$postlist = explode("|", $mybb->input['posts']);

if(!is_moderator_by_pids($postlist, "canmanagethreads"))

		$postlist = explode("|", $mybb->input['posts']);

if(!is_moderator_by_pids($postlist, "canmanagethreads"))

		{
error_no_permission();
}

		{
error_no_permission();
}

		
foreach($postlist as $pid)
{
$pid = intval($pid);
$plist[] = $pid;
}

		
foreach($postlist as $pid)
{
$pid = intval($pid);
$plist[] = $pid;
}





		$moderation->merge_posts($plist, $tid, $mybb->input['sep']);

mark_reports($plist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsmerged);
break;

		$moderation->merge_posts($plist, $tid, $mybb->input['sep']);

mark_reports($plist, "posts");
log_moderator_action($modlogdata, $lang->merged_selective_posts);
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_inline_postsmerged);
break;





	// 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->input['inlinetype'] == 'search')

		if($mybb->input['inlinetype'] == 'search')

		{

		{

			$posts = getids($mybb->input['searchid'], 'search');

			$posts = getids($mybb->input['searchid'], 'search');

		}

		}

		else
{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)

		else
{
$posts = getids($tid, 'thread');
}

if(count($posts) < 1)

		{

		{

			error($lang->error_inline_nopostsselected);

			error($lang->error_inline_nopostsselected);

		}

		}

		
if(!is_moderator_by_pids($posts, "canmanagethreads"))
{

		
if(!is_moderator_by_pids($posts, "canmanagethreads"))
{

Zeile 1469Zeile 1503
		// 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

		// 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, ".TABLE_PREFIX."posts q)
WHERE p.tid=q.tid AND p.pid IN ($pidin)
GROUP BY p.pid
");


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

		$threads = $pcheck = array();
while($tcheck = $db->fetch_array($query))
{

Zeile 1490Zeile 1525
			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)

			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.pid

			GROUP BY p.tid, p.pid

		");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))

		");
$pcheck2 = array();
while($tcheck = $db->fetch_array($query))

Zeile 1515Zeile 1550
		{
clearinline($tid, 'thread');
}

		{
clearinline($tid, 'thread');
}

		$forumselect = build_forum_jump("", $fid, 1, '', 0, '', "moveto");

		$forumselect = build_forum_jump("", $fid, 1, '', 0, true, '', "moveto");

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

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

Zeile 1683Zeile 1718
				if($mybb->input['inlinetype'] == 'search')
{
clearinline($mybb->input['searchid'], 'search');

				if($mybb->input['inlinetype'] == 'search')
{
clearinline($mybb->input['searchid'], 'search');

					$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
redirect($mybb->input['url'], $lang->redirect_customtool_search);


					$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);					
$return_url = htmlspecialchars_uni($mybb->input['url']);
redirect($return_url, $lang->redirect_customtool_search);

				}
else
{

				}
else
{

Zeile 1754Zeile 1790
				{
clearinline($mybb->input['searchid'], 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);

				{
clearinline($mybb->input['searchid'], 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);

					redirect($mybb->input['url'], $lang->redirect_customtool_search);


					$return_url = htmlspecialchars_uni($mybb->input['url']);
redirect($return_url, $lang->redirect_customtool_search);

				}
else
{

				}
else
{

Zeile 1906Zeile 1943
	global $mybb;
if(!empty($mybb->input['url']))
{

	global $mybb;
if(!empty($mybb->input['url']))
{

		redirect($mybb->input['url'], $message, $title);

		redirect(htmlentities($mybb->input['url']), $message, $title);

	}
redirect($url, $message, $title);
}

	}
redirect($url, $message, $title);
}