Vergleich moderation.php - 1.6.6 - 1.6.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: moderation.php 5587 2011-09-13 14:48:33Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'moderation.php');


$templatelist = 'changeuserbox';





$templatelist = 'changeuserbox,loginbox,moderation_delayedmoderation_custommodtool,moderation_delayedmodaction_notes,moderation_delayedmoderation_merge,moderation_delayedmoderation_move';
$templatelist .= ',moderation_delayedmoderation,moderation_deletethread,moderation_deletepoll,moderation_deleteposts_post,moderation_deleteposts,moderation_mergeposts_post,moderation_mergeposts';
$templatelist .= ',moderation_move,moderation_threadnotes_modaction,moderation_threadnotes_delayedmodaction,moderation_threadnotes,moderation_getip_modoptions,moderation_getip,moderation_merge';
$templatelist .= ',moderation_split_post,moderation_split,moderation_inline_deletethreads,moderation_inline_movethreads,moderation_inline_deleteposts,moderation_inline_mergeposts';
$templatelist .= ',moderation_inline_splitposts,forumjump_bit,forumjump_special,forumjump_advanced,forumdisplay_password_wrongpass,forumdisplay_password';


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 209Zeile 213
			
if($mybb->input['type'] == 'move')
{

			
if($mybb->input['type'] == 'move')
{

				$query = $db->simple_select("forums", "*", "fid='{$fid}'");
$newforum = $db->fetch_array($query);
if($newforum['type'] != 'f')

				$newforum = get_forum($fid);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')


				{
$errors[] = $lang->error_invalidforum;
}

				{
$errors[] = $lang->error_invalidforum;
}

Zeile 919Zeile 922
			error_no_permission();
}


			error_no_permission();
}


		$query = $db->simple_select("forums", "*", "fid='$moveto'");
$newforum = $db->fetch_array($query);
if($newforum['type'] != "f")

		$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')


		{
error($lang->error_invalidforum);
}

		{
error($lang->error_invalidforum);
}

Zeile 979Zeile 981
		{
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);
$modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']);

		{
$modaction['dateline'] = my_date("jS M Y, G:i", $modaction['dateline']);
$modaction['profilelink'] = build_profile_link($modaction['username'], $modaction['uid']);

 
			$modaction['action'] = htmlspecialchars_uni($modaction['action']);

			$info = '';
if($modaction['tsubject'])
{

			$info = '';
if($modaction['tsubject'])
{

Zeile 1022Zeile 1025
				$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))

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

		{
$actions['modtool_'.$tool['tid']] = htmlspecialchars_uni($tool['name']);

		{
$actions['modtool_'.$tool['tid']] = htmlspecialchars_uni($tool['name']);

		}

$forum_cache = $cache->read("forums");

		}

$forum_cache = $cache->read("forums");

Zeile 1040Zeile 1043
					LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=d.tids)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

					LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=d.tids)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=d.fid)
WHERE ','||d.tids||',' LIKE '%,{$tid},%'

					ORDER BY d.dateline DESC

					ORDER BY d.dateline DESC

					LIMIT  0, 20
");
break;

					LIMIT  0, 20
");
break;

Zeile 1058Zeile 1061
		}
while($delayedmod = $db->fetch_array($query))
{

		}
while($delayedmod = $db->fetch_array($query))
{

			$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['dateline']+($delayedmod['delay']*24*60*60));

			$delayedmod['dateline'] = my_date("jS M Y, G:i", $delayedmod['delaydateline']);

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';

			$delayedmod['profilelink'] = build_profile_link($delayedmod['username'], $delayedmod['uid']);
$delayedmod['action'] = $actions[$delayedmod['type']];
$info = '';

Zeile 1139Zeile 1142
		{
$hostname = $lang->resolve_fail;
}

		{
$hostname = $lang->resolve_fail;
}

 

$username = build_profile_link($post['username'], $post['uid']);


// Moderator options
$modoptions = "";


// Moderator options
$modoptions = "";

Zeile 1258Zeile 1263

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



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


		moderation_redirect("showthread.php?tid=$tid", $lang->redirect_threadsmerged);

		moderation_redirect(get_thread_link($tid), $lang->redirect_threadsmerged);

		break;

// Divorce the posts in this thread (Split!)

		break;

// Divorce the posts in this thread (Split!)

Zeile 1350Zeile 1355
		{
$moveto = $fid;
}

		{
$moveto = $fid;
}

		$query = $db->simple_select("forums", "fid", "fid='$moveto'", array('limit' => 1));
if($db->num_rows($query) == 0)



$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

		{
error($lang->error_invalidforum);

		{
error($lang->error_invalidforum);

		}


		}


		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

		// move the selected posts over
$query = $db->simple_select("posts", "pid", "tid='$tid'");
while($post = $db->fetch_array($query))

Zeile 1368Zeile 1374
		}

$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->input['newsubject']);

		}

$newtid = $moderation->split_posts($pids, $tid, $moveto, $mybb->input['newsubject']);





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

moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);

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

moderation_redirect(get_thread_link($newtid), $lang->redirect_threadsplit);

Zeile 1377Zeile 1383
	// Delete Thread Subscriptions
case "removesubscriptions":
if(!is_moderator($fid, "canmanagethreads"))

	// Delete Thread Subscriptions
case "removesubscriptions":
if(!is_moderator($fid, "canmanagethreads"))

		{

		{

			error_no_permission();
}


			error_no_permission();
}


Zeile 1407Zeile 1413
		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'candeleteposts'))

		{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'candeleteposts'))

			{
error_no_permission();

			{
error_no_permission();

			}

			}

		}

		}

		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

		}

		}

		
$inlineids = implode("|", $threads);

		
$inlineids = implode("|", $threads);

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

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

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

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

Zeile 1432Zeile 1438

// Actually delete the threads - Inline moderation
case "do_multideletethreads":


// Actually delete the threads - Inline moderation
case "do_multideletethreads":





		// 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 1440Zeile 1446
		if(!is_moderator_by_tids($threadlist, "candeleteposts"))
{
error_no_permission();

		if(!is_moderator_by_tids($threadlist, "candeleteposts"))
{
error_no_permission();

		}

		}

		foreach($threadlist as $tid)
{
$tid = intval($tid);

		foreach($threadlist as $tid)
{
$tid = intval($tid);

Zeile 1473Zeile 1479
			if(!is_moderator_by_tids($threads, 'canopenclosethreads'))
{
error_no_permission();

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

$moderation->open_threads($threads);

log_moderator_action($modlogdata, $lang->multi_opened_threads);
if($mybb->input['inlinetype'] == 'search')
{
clearinline($mybb->input['searchid'], 'search');
}
else
{
clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;

// Close threads - Inline moderation
case "multiclosethreads":

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

		}
else
{
$threads = getids($fid, 'forum');

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

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

			{
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->close_threads($threads);











































		}

$moderation->open_threads($threads);

log_moderator_action($modlogdata, $lang->multi_opened_threads);
if($mybb->input['inlinetype'] == 'search')
{
clearinline($mybb->input['searchid'], 'search');
}
else
{
clearinline($fid, 'forum');
}
moderation_redirect(get_forum_link($fid), $lang->redirect_inline_threadsopened);
break;

// Close threads - Inline moderation
case "multiclosethreads":

// 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->close_threads($threads);


log_moderator_action($modlogdata, $lang->multi_closed_threads);
if($mybb->input['inlinetype'] == 'search')


log_moderator_action($modlogdata, $lang->multi_closed_threads);
if($mybb->input['inlinetype'] == 'search')

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

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

		}
if(count($threads) < 1)
{

Zeile 1599Zeile 1605
			// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canmanagethreads'))

			// From search page
$threads = getids($mybb->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 1619Zeile 1625
		$moderation->unapprove_threads($threads, $fid);

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

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

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

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

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

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

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

Zeile 1633Zeile 1639

// Stick threads - Inline moderation
case "multistickthreads":


// Stick threads - Inline moderation
case "multistickthreads":





		// 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 1642Zeile 1648
			// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canopenclosethreads'))

			// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canopenclosethreads'))

			{

			{

				error_no_permission();
}
}

				error_no_permission();
}
}

Zeile 1674Zeile 1680
		break;

// Unstick threads - Inline moderaton

		break;

// Unstick threads - Inline moderaton

	case "multiunstickthreads":

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

if(!empty($mybb->input['searchid']))
{

	case "multiunstickthreads":

// 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, 'canopenclosethreads'))

			// From search page
$threads = getids($mybb->input['searchid'], 'search');
if(!is_moderator_by_tids($threads, 'canopenclosethreads'))

Zeile 1688Zeile 1694
				error_no_permission();
}
}

				error_no_permission();
}
}

		else
{
$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)

		else









		{

		{

			error($lang->error_inline_nothreadsselected);









			$threads = getids($fid, 'forum');
if(!is_moderator($fid, 'canopenclosethreads'))
{
error_no_permission();
}
}
if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);

		}

$moderation->unstick_threads($threads);

		}

$moderation->unstick_threads($threads);

Zeile 1735Zeile 1741
			{
error_no_permission();
}

			{
error_no_permission();
}

		}


		}


		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);
}
$inlineids = implode("|", $threads);
if($mybb->input['inlinetype'] == 'search')

		if(count($threads) < 1)
{
error($lang->error_inline_nothreadsselected);
}
$inlineids = implode("|", $threads);
if($mybb->input['inlinetype'] == 'search')

		{

		{

			clearinline($mybb->input['searchid'], 'search');

			clearinline($mybb->input['searchid'], 'search');

		}

		}

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

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

Zeile 1754Zeile 1760
		$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);

		break;

		break;


// Actually move the threads in Inline moderation
case "do_multimovethreads":


// Actually move the threads in Inline moderation
case "do_multimovethreads":

Zeile 1780Zeile 1786
		}

$newforum = get_forum($moveto);

		}

$newforum = get_forum($moveto);

		if($newforum['type'] != "f")

		if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

		{
error($lang->error_invalidforum);
}

		{
error($lang->error_invalidforum);
}

Zeile 1812Zeile 1818
		if(!is_moderator_by_pids($posts, "candeleteposts"))
{
error_no_permission();

		if(!is_moderator_by_pids($posts, "candeleteposts"))
{
error_no_permission();

		}

		}

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

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

		{

		{

			clearinline($mybb->input['searchid'], 'search');

			clearinline($mybb->input['searchid'], 'search');

		}

		}

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

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

Zeile 1830Zeile 1836
		break;

// Actually delete the posts in inline moderation

		break;

// Actually delete the posts in inline moderation

	case "do_multideleteposts":

	case "do_multideleteposts":


// 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 2127Zeile 2133
		{
$moveto = $fid;
}

		{
$moveto = $fid;
}

		$query = $db->simple_select("forums", "COUNT(fid) as count", "fid='$moveto'");
if($db->fetch_field($query, 'count') == 0)



$newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')

		{
error($lang->error_invalidforum);
}

		{
error($lang->error_invalidforum);
}

		$newsubject = $mybb->input['newsubject'];

 




 
		$newsubject = $mybb->input['newsubject'];

		$newtid = $moderation->split_posts($plist, $tid, $moveto, $newsubject);

$pid_list = implode(', ', $plist);

		$newtid = $moderation->split_posts($plist, $tid, $moveto, $newsubject);

$pid_list = implode(', ', $plist);