Vergleich modcp.php - 1.8.13 - 1.8.32

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 56Zeile 56
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = '';
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();

$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = '';
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();

 
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;

if($mybb->usergroup['issupermod'] != 1)
{

if($mybb->usergroup['issupermod'] != 1)
{

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id='{$mybb->user['usergroup']}' AND isgroup = '1')");

$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;

	$query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");



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

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

		// For Announcements
if($forum['canmanageannouncements'] == 1)
{
++$numannouncements;
}














		$moderated_forums[] = $forum['fid'];
$children = get_child_list($forum['fid']);
if(is_array($children))
{
$moderated_forums = array_merge($moderated_forums, $children);
}
}
$moderated_forums = array_unique($moderated_forums);

$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
foreach($moderated_forums as $moderated_forum)
{
// For Announcements
if(is_moderator($moderated_forum, 'canmanageannouncements'))
{
++$numannouncements;
}


		// For the Mod Queues

		// For the Mod Queues

		if($forum['canapproveunapprovethreads'] == 1)

		if(is_moderator($moderated_forum, 'canapproveunapprovethreads'))

		{

		{

			$flist_queue_threads .= ",'{$forum['fid']}'";

$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist_queue_threads .= ",'".implode("','", $children)."'";
}

			$flist_queue_threads .= ",'{$moderated_forum}'";







			++$nummodqueuethreads;
}


			++$nummodqueuethreads;
}


		if($forum['canapproveunapproveposts'] == 1)
{
$flist_queue_posts .= ",'{$forum['fid']}'";

$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist_queue_posts .= ",'".implode("','", $children)."'";
}
++$nummodqueueposts;
}

if($forum['canapproveunapproveattachs'] == 1)

		if(is_moderator($moderated_forum, 'canapproveunapproveposts'))
{
$flist_queue_posts .= ",'{$moderated_forum}'";
++$nummodqueueposts;
}

if(is_moderator($moderated_forum, 'canapproveunapproveattachs'))







		{

		{

			$flist_queue_attach .= ",'{$forum['fid']}'";

$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist_queue_attach .= ",'".implode("','", $children)."'";
}

			$flist_queue_attach .= ",'{$moderated_forum}'";







			++$nummodqueueattach;
}

// For Reported posts

			++$nummodqueueattach;
}

// For Reported posts

		if($forum['canmanagereportedposts'] == 1)

		if(is_moderator($moderated_forum, 'canmanagereportedposts'))

		{

		{

			$flist_reports .= ",'{$forum['fid']}'";

$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist_reports .= ",'".implode("','", $children)."'";
}

			$flist_reports .= ",'{$moderated_forum}'";







			++$numreportedposts;
}

// For the Mod Log

			++$numreportedposts;
}

// For the Mod Log

		if($forum['canviewmodlog'] == 1)

		if(is_moderator($moderated_forum, 'canviewmodlog'))

		{

		{

			$flist_modlog .= ",'{$forum['fid']}'";

$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist_modlog .= ",'".implode("','", $children)."'";
}

			$flist_modlog .= ",'{$moderated_forum}'";







			++$nummodlogs;

			++$nummodlogs;

		}

$flist .= ",'{$forum['fid']}'";

		}







		$children = get_child_list($forum['fid']);
if(!empty($children))
{
$flist .= ",'".implode("','", $children)."'";
}
$moderated_forums[] = $forum['fid'];

		$flist .= ",'{$moderated_forum}'";






	}
if($flist_queue_threads)
{

	}
if($flist_queue_threads)
{

Zeile 247Zeile 221
if($mybb->usergroup['canbanusers'] == 1)
{
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");

if($mybb->usergroup['canbanusers'] == 1)
{
eval("\$nav_banning = \"".$templates->get("modcp_nav_banning")."\";");

}


}


if($mybb->usergroup['canviewwarnlogs'] == 1)

if($mybb->usergroup['canviewwarnlogs'] == 1)

{

{

	eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";");
}

if($mybb->usergroup['canuseipsearch'] == 1)

	eval("\$nav_warninglogs = \"".$templates->get("modcp_nav_warninglogs")."\";");
}

if($mybb->usergroup['canuseipsearch'] == 1)

{

{

	eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
}

	eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
}





$plugins->run_hooks("modcp_nav");

if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs))
{

$plugins->run_hooks("modcp_nav");

if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs))
{

 
	$expaltext = (in_array("modcpforums", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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

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

}

}


if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch))
{


if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch))
{

 
	$expaltext = (in_array("modcpusers", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";");
}


	eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";");
}


Zeile 291Zeile 267
	}

$message = $lang->redirect_reportsmarked;

	}

$message = $lang->redirect_reportsmarked;





	if(isset($mybb->cookies['inlinereports']))
{
if($mybb->cookies['inlinereports'] == '|ALL|') {

	if(isset($mybb->cookies['inlinereports']))
{
if($mybb->cookies['inlinereports'] == '|ALL|') {

Zeile 309Zeile 285
		{
$inlinereportlist = explode("|", $mybb->cookies['inlinereports']);
$reports = array_map("intval", $inlinereportlist);

		{
$inlinereportlist = explode("|", $mybb->cookies['inlinereports']);
$reports = array_map("intval", $inlinereportlist);





			if(!count($reports))
{
error($lang->error_noselected_reports);
}

			if(!count($reports))
{
error($lang->error_noselected_reports);
}





			$rids = implode("','", $reports);

$sql = "rid IN ('0','{$rids}')";

			$rids = implode("','", $reports);

$sql = "rid IN ('0','{$rids}')";

		}
}
else

		}
}
else

	{
$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode("','", $mybb->input['reports']);

$sql = "rid IN ('0','{$rids}')";

	{
$mybb->input['reports'] = array_map("intval", $mybb->input['reports']);
$rids = implode("','", $mybb->input['reports']);

$sql = "rid IN ('0','{$rids}')";

	}

	}


$plugins->run_hooks("modcp_do_reports");


$plugins->run_hooks("modcp_do_reports");





	$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}");
$cache->update_reportedcontent();

my_unsetcookie('inlinereports');
my_unsetcookie('inlinereports_removed');


	$db->update_query("reportedcontent", array('reportstatus' => 1), "{$sql}{$flist_reports}");
$cache->update_reportedcontent();

my_unsetcookie('inlinereports');
my_unsetcookie('inlinereports_removed');


	$page = $mybb->get_input('page', MyBB::INPUT_INT);


	$page = $mybb->get_input('page', MyBB::INPUT_INT);


	redirect("modcp.php?action=reports&page={$page}", $message);
}

if($mybb->input['action'] == "reports")
{
if($mybb->usergroup['canmanagereportedcontent'] == 0)

	redirect("modcp.php?action=reports&page={$page}", $message);
}

if($mybb->input['action'] == "reports")
{
if($mybb->usergroup['canmanagereportedcontent'] == 0)

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 371Zeile 347
	else
{
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");

	else
{
$query = $db->simple_select('reportedcontent', 'id3', "reportstatus='0' AND (type = 'post' OR type = '')");





		$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))
{

		$report_count = 0;
while($fid = $db->fetch_field($query, 'id3'))
{

Zeile 390Zeile 366
	$pages = ceil($pages);

if($page > $pages || $page <= 0)

	$pages = ceil($pages);

if($page > $pages || $page <= 0)

	{
$page = 1;
}


	{
$page = 1;
}


	if($page && $page > 0)
{
$start = ($page-1) * $perpage;
}
else

	if($page && $page > 0)
{
$start = ($page-1) * $perpage;
}
else

	{

	{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

Zeile 414Zeile 390
	$plugins->run_hooks("modcp_reports_start");

// Reports

	$plugins->run_hooks("modcp_reports_start");

// Reports

	$reports = '';



	$reports = $selectall = '';
$inlinecount = 0;


	$query = $db->query("
SELECT r.*, u.username, rr.title
FROM ".TABLE_PREFIX."reportedcontent r

	$query = $db->query("
SELECT r.*, u.username, rr.title
FROM ".TABLE_PREFIX."reportedcontent r

Zeile 530Zeile 508

$plugins->run_hooks('modcp_reports_intermediate');



$plugins->run_hooks('modcp_reports_intermediate');


		$inlinecount = 0;

 
		// Now that we have all of the information needed, display the reports
foreach($reportcache as $report)
{

		// Now that we have all of the information needed, display the reports
foreach($reportcache as $report)
{

Zeile 540Zeile 517
			{
// Assume a post
$report['type'] = 'post';

			{
// Assume a post
$report['type'] = 'post';

			}

			}


// Report Information
$report_data = array();


// Report Information
$report_data = array();

Zeile 686Zeile 663
		else
{
$page = (int)$result / $perpage + 1;

		else
{
$page = (int)$result / $perpage + 1;

		}

		}

	}
$postcount = (int)$report_count;
$pages = $postcount / $perpage;

	}
$postcount = (int)$report_count;
$pages = $postcount / $perpage;

Zeile 908Zeile 885
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}


	}


	$page_url = 'modcp.php?action=modlogs&amp;perpage='.$perpage;
foreach(array('uid', 'fid') as $field)
{

	$page_url = 'modcp.php?action=modlogs&amp;perpage='.$perpage;
foreach(array('uid', 'fid') as $field)
{

Zeile 1048Zeile 1025
}

if($mybb->input['action'] == "do_delete_announcement")

}

if($mybb->input['action'] == "do_delete_announcement")

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

if($mybb->usergroup['canmanageannounce'] == 0)
{
error_no_permission();
}

$aid = $mybb->get_input('aid');
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

if(!$announcement)
{
error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}

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

if($mybb->usergroup['canmanageannounce'] == 0)
{
error_no_permission();
}

$aid = $mybb->get_input('aid');
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
$announcement = $db->fetch_array($query);

if(!$announcement)
{
error($lang->error_invalid_announcement);
}
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();
}


$plugins->run_hooks("modcp_do_delete_announcement");


$plugins->run_hooks("modcp_do_delete_announcement");





	$db->delete_query("announcements", "aid='{$aid}'");
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);
$cache->update_forumsdisplay();

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);

	$db->delete_query("announcements", "aid='{$aid}'");
log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted);
$cache->update_forumsdisplay();

redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);

}


}


if($mybb->input['action'] == "delete_announcement")
{
if($mybb->usergroup['canmanageannounce'] == 0)

if($mybb->input['action'] == "delete_announcement")
{
if($mybb->usergroup['canmanageannounce'] == 0)

Zeile 1086Zeile 1063
	}

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

	}

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

	$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");


	$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");


	$announcement = $db->fetch_array($query);
$announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));

	$announcement = $db->fetch_array($query);
$announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));





	if(!$announcement)
{
error($lang->error_invalid_announcement);

	if(!$announcement)
{
error($lang->error_invalid_announcement);

	}


	}


	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();

	if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
{
error_no_permission();

Zeile 1112Zeile 1089
	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->usergroup['canmanageannounce'] == 0)

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

if($mybb->usergroup['canmanageannounce'] == 0)

	{
error_no_permission();
}

	{
error_no_permission();
}


$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))


$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))

Zeile 1132Zeile 1109

$mybb->input['message'] = $mybb->get_input('message');
if(!trim($mybb->input['message']))


$mybb->input['message'] = $mybb->get_input('message');
if(!trim($mybb->input['message']))

	{

	{

		$errors[] = $lang->error_missing_message;
}


		$errors[] = $lang->error_missing_message;
}


Zeile 1187Zeile 1164
		$mybb->input['endtime_month'] = '01';
}
else

		$mybb->input['endtime_month'] = '01';
}
else

	{

	{

		$mybb->input['endtime_month'] = $mybb->get_input('endtime_month');
if(!in_array($mybb->input['endtime_month'], $months))
{

		$mybb->input['endtime_month'] = $mybb->get_input('endtime_month');
if(!in_array($mybb->input['endtime_month'], $months))
{

Zeile 1206Zeile 1183
	}

if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	}

if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)

	{

	{

		$allowhtml = 1;

		$allowhtml = 1;

	}

	}

	else

	else

	{

	{

		$allowhtml = 0;

		$allowhtml = 0;

	}

	}

	if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1)
{
$allowmycode = 1;

	if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1)
{
$allowmycode = 1;

	}
else
{

	}
else
{

		$allowmycode = 0;

		$allowmycode = 0;

	}

	}

	if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)
{
$allowsmilies = 1;

	if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1)
{
$allowsmilies = 1;

	}
else

	}
else

	{
$allowsmilies = 0;
}

	{
$allowsmilies = 0;
}

Zeile 1253Zeile 1230
				'allowsmilies' => $allowsmilies
);
$aid = $db->insert_query("announcements", $insert_announcement);

				'allowsmilies' => $allowsmilies
);
$aid = $db->insert_query("announcements", $insert_announcement);





			log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);

$plugins->run_hooks("modcp_do_new_announcement_end");

			log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);

$plugins->run_hooks("modcp_do_new_announcement_end");

Zeile 1271Zeile 1248
if($mybb->input['action'] == "new_announcement")
{
if($mybb->usergroup['canmanageannounce'] == 0)

if($mybb->input['action'] == "new_announcement")
{
if($mybb->usergroup['canmanageannounce'] == 0)

	{

	{

		error_no_permission();
}

		error_no_permission();
}





	add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");

	add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");





	$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);

if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))

	$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);

if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))

	{
error_no_permission();

	{
error_no_permission();

	}

// Deal with inline errors

	}

// Deal with inline errors

Zeile 1933Zeile 1910
			foreach($global_announcements as $aid => $announcement)
{
$trow = alt_trow();

			foreach($global_announcements as $aid => $announcement)
{
$trow = alt_trow();

				if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))

				if((isset($announcement['startdate']) && $announcement['startdate'] > TIME_NOW) || (isset($announcement['enddate']) && $announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))

				{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");
}

				{
eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";");
}

Zeile 2303Zeile 2280
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid

			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid

			ORDER BY p.dateline DESC

			ORDER BY p.dateline DESC, p.pid DESC

			LIMIT {$start}, {$perpage}
");
$posts = '';

			LIMIT {$start}, {$perpage}
");
$posts = '';

Zeile 2473Zeile 2450
			if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1)
{
eval("\$thread_link = \"".$templates->get("modcp_modqueue_thread_link")."\";");

			if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1)
{
eval("\$thread_link = \"".$templates->get("modcp_modqueue_thread_link")."\";");

				$navsep = " | ";
}

if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{

				$navsep = " | ";
}

if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
{

				eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
$navsep = " | ";
}

				eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
$navsep = " | ";
}

Zeile 2486Zeile 2463
			eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);
}

			eval("\$attachmentqueue = \"".$templates->get("modcp_modqueue_attachments")."\";");
output_page($attachmentqueue);
}

	}


	}


	// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)
{

	// Still nothing? All queues are empty! :-D
if(!$threadqueue && !$postqueue && !$attachmentqueue)
{

Zeile 2503Zeile 2480
if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_editprofile")
{
// Verify incoming POST request

	verify_post_check($mybb->input['my_post_key']);

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


if($mybb->usergroup['caneditprofiles'] == 0)


if($mybb->usergroup['caneditprofiles'] == 0)

	{
error_no_permission();

	{
error_no_permission();

	}

$user = get_user($mybb->input['uid']);

	}

$user = get_user($mybb->input['uid']);

Zeile 2535Zeile 2512
				$mybb->input['awaymonth'] = my_date('n', $awaydate);
}
if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))

				$mybb->input['awaymonth'] = my_date('n', $awaydate);
}
if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))

			{

			{

				$mybb->input['awayyear'] = my_date('Y', $awaydate);
}


				$mybb->input['awayyear'] = my_date('Y', $awaydate);
}


Zeile 2552Zeile 2529
			}

$returndate = "{$return_day}-{$return_month}-{$return_year}";

			}

$returndate = "{$return_day}-{$return_month}-{$return_year}";

		}
else

		}
else

		{
$returndate = "";
}

		{
$returndate = "";
}

Zeile 2585Zeile 2562
		"profile_fields_editable" => true,
"website" => $mybb->get_input('website'),
"icq" => $mybb->get_input('icq'),

		"profile_fields_editable" => true,
"website" => $mybb->get_input('website'),
"icq" => $mybb->get_input('icq'),

		"aim" => $mybb->get_input('aim'),
"yahoo" => $mybb->get_input('yahoo'),

 
		"skype" => $mybb->get_input('skype'),
"google" => $mybb->get_input('google'),
"signature" => $mybb->get_input('signature'),
"usernotes" => $mybb->get_input('usernotes'),
"away" => $away

		"skype" => $mybb->get_input('skype'),
"google" => $mybb->get_input('google'),
"signature" => $mybb->get_input('signature'),
"usernotes" => $mybb->get_input('usernotes'),
"away" => $away

	);


	);


	$updated_user['birthday'] = array(
"day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
"month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT),

	$updated_user['birthday'] = array(
"day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
"month" => $mybb->get_input('birthday_month', MyBB::INPUT_INT),

Zeile 2607Zeile 2582
	else if(!empty($mybb->input['reverttitle']))
{
$updated_user['usertitle'] = '';

	else if(!empty($mybb->input['reverttitle']))
{
$updated_user['usertitle'] = '';

	}


	}


	if(!empty($mybb->input['remove_avatar']))
{
$updated_user['avatarurl'] = '';

	if(!empty($mybb->input['remove_avatar']))
{
$updated_user['avatarurl'] = '';

Zeile 2616Zeile 2591

// Set the data of the user in the datahandler.
$userhandler->set_data($updated_user);


// Set the data of the user in the datahandler.
$userhandler->set_data($updated_user);

	$errors = '';

	$errors = array();


// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())


// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())

Zeile 2665Zeile 2640
		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

		require_once MYBB_ROOT."inc/functions_warnings.php";
foreach($moderator_options as $option)
{

			$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);

			${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);

			$mybb->input[$option['period']] = $mybb->get_input($option['period']);
if(empty($mybb->input[$option['action']]))
{

			$mybb->input[$option['period']] = $mybb->get_input($option['period']);
if(empty($mybb->input[$option['action']]))
{

Zeile 2688Zeile 2663
					$string = $option['action']."_error";
$errors[] = $lang->$string;
}

					$string = $option['action']."_error";
$errors[] = $lang->$string;
}


if(!is_array($errors))

				else


				{
$suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);


				{
$suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);


Zeile 2726Zeile 2700

// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting


// Those with javascript turned off will be able to select both - cheeky!
// Check to make sure we're not moderating AND suspending posting

		if(isset($extra_user_updates) && $extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

		if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting']))

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


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


		if(is_array($errors))

		if(is_array($errors) && !empty($errors))

		{
$mybb->input['action'] = "editprofile";
}

		{
$mybb->input['action'] = "editprofile";
}

Zeile 2775Zeile 2749
		error_no_permission();
}


		error_no_permission();
}


	if(!my_validate_url($user['website']))

















	$userperms = user_permissions($user['uid']);

// Set display group
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{
$userperms = array_merge($userperms, $display_group);
}

if(!my_validate_url($user['website']))

	{
$user['website'] = '';
}

	{
$user['website'] = '';
}

Zeile 2783Zeile 2773
	if($user['icq'] != "0")
{
$user['icq'] = (int)$user['icq'];

	if($user['icq'] != "0")
{
$user['icq'] = (int)$user['icq'];

	}

	}


if(!$errors)
{


if(!$errors)
{

Zeile 2798Zeile 2788
			$birthday[2] = '';
}
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = $birthday;

			$birthday[2] = '';
}
list($mybb->input['birthday_day'], $mybb->input['birthday_month'], $mybb->input['birthday_year']) = $birthday;

	}
else
{

	}
else
{

		$errors = inline_error($errors);

		$errors = inline_error($errors);

	}


	}


	// Sanitize all input

	// Sanitize all input

	foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)

	foreach(array('usertitle', 'website', 'icq', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)

	{
$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field));

	{
$mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field));

	}

// Custom user title, check to see if we have a default group title
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

$displaygroupfields = array('usertitle');
$display_group = usergroup_displaygroup($user['displaygroup']);

if(!empty($display_group['usertitle']))

	}

// Custom user title
if(!empty($userperms['usertitle']))









	{

	{

		$defaulttitle = htmlspecialchars_uni($display_group['usertitle']);

		$defaulttitle = htmlspecialchars_uni($userperms['usertitle']);

	}
else
{

	}
else
{

Zeile 2832Zeile 2814
		{
if($title['posts'] <= $user['postnum'])
{

		{
if($title['posts'] <= $user['postnum'])
{

				$defaulttitle = $title['title'];

				$defaulttitle = htmlspecialchars_uni($title['title']);

				break;
}

				break;
}

		}
}

$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);

		}
}

$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);


if(empty($user['usertitle']))
{


if(empty($user['usertitle']))
{

Zeile 2864Zeile 2846
	foreach(range(1, 12) as $month)
{
$bdaymonthsel[$month] = '';

	foreach(range(1, 12) as $month)
{
$bdaymonthsel[$month] = '';

	}

	}

	$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

if($mybb->settings['allowaway'] != 0)

	$bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';

if($mybb->settings['allowaway'] != 0)

Zeile 2938Zeile 2920
	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

	$plugins->run_hooks("modcp_editprofile_start");

// Fetch profile fields

 
	$user_fields = array();

	$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");

	$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");

	$user_fields = $db->fetch_array($query);





	if($db->num_rows($query) > 0)
{
$user_fields = $db->fetch_array($query);
}


	$requiredfields = '';
$customfields = '';
$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);

	$requiredfields = '';
$customfields = '';
$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);





	$pfcache = $cache->read('profilefields');

	$pfcache = $cache->read('profilefields');





	if(is_array($pfcache))
{
foreach($pfcache as $profilefield)

	if(is_array($pfcache))
{
foreach($pfcache as $profilefield)

Zeile 2964Zeile 2950
			}
$field = "fid{$profilefield['fid']}";
if($errors)

			}
$field = "fid{$profilefield['fid']}";
if($errors)

			{

			{

				if(isset($mybb->input['profile_fields'][$field]))
{
$userfield = $mybb->input['profile_fields'][$field];
}
}

				if(isset($mybb->input['profile_fields'][$field]))
{
$userfield = $mybb->input['profile_fields'][$field];
}
}

			else

			elseif(isset($user_fields[$field]))

			{
$userfield = $user_fields[$field];
}

			{
$userfield = $user_fields[$field];
}

Zeile 2983Zeile 2969
				else
{
$useropts = explode("\n", $userfield);

				else
{
$useropts = explode("\n", $userfield);

				}

				}

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

Zeile 3010Zeile 2996
					if(!$profilefield['length'])
{
$profilefield['length'] = 3;

					if(!$profilefield['length'])
{
$profilefield['length'] = 3;

					}

eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
}
}

					}

eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
}
}

			elseif($type == "select")
{
$expoptions = explode("\n", $options);

			elseif($type == "select")
{
$expoptions = explode("\n", $options);

Zeile 3033Zeile 3019
						eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

						eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

					{

					{

						$profilefield['length'] = 1;
}


						$profilefield['length'] = 1;
}


Zeile 3041Zeile 3027
				}
}
elseif($type == "radio")

				}
}
elseif($type == "radio")

			{
$expoptions = explode("\n", $options);

			{
$expoptions = explode("\n", $options);

				if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

				if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$checked = "";
if($val == $userfield)

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

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


eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
}


eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
}

Zeile 3070Zeile 3056
				if(is_array($useropts))
{
foreach($useropts as $key => $val)

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

					{

					{

						$seloptions[$val] = $val;
}
}

						$seloptions[$val] = $val;
}
}

Zeile 3086Zeile 3072
						}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");

						}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");

					}
}
}

					}
}
}

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);

Zeile 3107Zeile 3093
			}

if($profilefield['required'] == 1)

			}

if($profilefield['required'] == 1)

			{

			{

				eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

				eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
else

Zeile 3134Zeile 3120
	{
$checked = 1;
$checked_item = "checked=\"checked\"";

	{
$checked = 1;
$checked_item = "checked=\"checked\"";

	}
else

	}
else

	{
$checked = 0;
$checked_item = '';

	{
$checked = 0;
$checked_item = '';

Zeile 3163Zeile 3149
	{
$suspost_check = 0;
$suspost_checked = '';

	{
$suspost_check = 0;
$suspost_checked = '';

	}

	}


$moderator_options = array(
1 => array(


$moderator_options = array(
1 => array(

Zeile 3199Zeile 3185

$suspendsignature_info = $moderateposts_info = $suspendposting_info = '';
$action_options = $modpost_options = $suspost_options = '';


$suspendsignature_info = $moderateposts_info = $suspendposting_info = '';
$action_options = $modpost_options = $suspost_options = '';

 
	$modopts = array();

	foreach($moderator_options as $option)
{

	foreach($moderator_options as $option)
{

		$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);

		${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);

		// Display the suspension info, if this user has this option suspended
if($user[$option['option']])
{

		// Display the suspension info, if this user has this option suspended
if($user[$option['option']])
{

Zeile 3239Zeile 3226
		{
$string = $option['select_option']."_period";
if($mybb->get_input($string) == $key)

		{
$string = $option['select_option']."_period";
if($mybb->get_input($string) == $key)

			{

			{

				$selected = "selected=\"selected\"";

				$selected = "selected=\"selected\"";

			}

			}

			else
{
$selected = '';
}

			else
{
$selected = '';
}





			eval("\$selection_options .= \"".$templates->get("modcp_editprofile_select_option")."\";");

			eval("\$selection_options .= \"".$templates->get("modcp_editprofile_select_option")."\";");

		}


		}


		$select_name = $option['select_option']."_period";
switch($option['option'])
{

		$select_name = $option['select_option']."_period";
switch($option['option'])
{

Zeile 3258Zeile 3245
				break;
case "moderateposts":
eval("\$modpost_options = \"".$templates->get("modcp_editprofile_select")."\";");

				break;
case "moderateposts":
eval("\$modpost_options = \"".$templates->get("modcp_editprofile_select")."\";");

				break;

				break;

			case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;

			case "suspendposting":
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";");
break;

Zeile 3273Zeile 3260
	{
$newtitle = '';
}

	{
$newtitle = '';
}

 

$birthday_year = $mybb->input['birthday_year'];
$user_website = $mybb->input['website'];
$user_icq = $mybb->input['icq'];
$user_skype = $mybb->input['skype'];
$user_google = $mybb->input['google'];


$plugins->run_hooks("modcp_editprofile_end");



$plugins->run_hooks("modcp_editprofile_end");


Zeile 3285Zeile 3278
	if($mybb->usergroup['caneditprofiles'] == 0)
{
error_no_permission();

	if($mybb->usergroup['caneditprofiles'] == 0)
{
error_no_permission();

	}


	}


	add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);

	add_breadcrumb($lang->mcp_nav_users, "modcp.php?action=finduser");

$perpage = $mybb->get_input('perpage', MyBB::INPUT_INT);

Zeile 3295Zeile 3288
		$perpage = $mybb->settings['threadsperpage'];
}
$where = '';

		$perpage = $mybb->settings['threadsperpage'];
}
$where = '';





	if(isset($mybb->input['username']))
{
switch($db->type)

	if(isset($mybb->input['username']))
{
switch($db->type)

Zeile 3313Zeile 3306

// Sort order & direction
switch($mybb->get_input('sortby'))


// Sort order & direction
switch($mybb->get_input('sortby'))

	{

	{

		case "lastvisit":
$sortby = "lastvisit";
break;

		case "lastvisit":
$sortby = "lastvisit";
break;

Zeile 3420Zeile 3413

$plugins->run_hooks("modcp_finduser_end");



$plugins->run_hooks("modcp_finduser_end");


 
	$username = htmlspecialchars_uni($mybb->get_input('username'));

	eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");
output_page($finduser);
}

	eval("\$finduser = \"".$templates->get("modcp_finduser")."\";");
output_page($finduser);
}

Zeile 3463Zeile 3457
		$mybb->input['filter']['uid'] = '';
}
if(!empty($mybb->input['filter']['mod_username']))

		$mybb->input['filter']['uid'] = '';
}
if(!empty($mybb->input['filter']['mod_username']))

	{

	{

		$mod_user = get_user_by_username($mybb->input['filter']['mod_username']);

$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];

		$mod_user = get_user_by_username($mybb->input['filter']['mod_username']);

$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid'];

Zeile 3507Zeile 3501
		case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

		case "username":
$sortby = "u.username";
$sortbysel['username'] = ' selected="selected"';

			break;

			break;

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

		case "expires":
$sortby = "w.expires";
$sortbysel['expires'] = ' selected="selected"';

Zeile 3534Zeile 3528
	else
{
$ordersel['asc'] = ' selected="selected"';

	else
{
$ordersel['asc'] = ' selected="selected"';

	}

$plugins->run_hooks("modcp_warninglogs_start");


	}

$plugins->run_hooks("modcp_warninglogs_start");


	// Pagination stuff
$sql = "
SELECT COUNT(wid) as count

	// Pagination stuff
$sql = "
SELECT COUNT(wid) as count

Zeile 3551Zeile 3545
	$total_warnings = $db->fetch_field($query, 'count');
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page <= 0)

	$total_warnings = $db->fetch_field($query, 'count');
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page <= 0)

	{

	{

		$page = 1;
}
$per_page = 20;

		$page = 1;
}
$per_page = 20;

Zeile 3560Zeile 3554
		$per_page = (int)$mybb->input['filter']['per_page'];
}
$start = ($page-1) * $per_page;

		$per_page = (int)$mybb->input['filter']['per_page'];
}
$start = ($page-1) * $per_page;

 
	$pages = ceil($total_warnings / $per_page);
if($page > $pages)
{
$start = 0;
$page = 1;
}

	// Build the base URL for pagination links
$url = 'modcp.php?action=warninglogs';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

	// Build the base URL for pagination links
$url = 'modcp.php?action=warninglogs';
if(is_array($mybb->input['filter']) && count($mybb->input['filter']))

Zeile 3636Zeile 3636
	}

$plugins->run_hooks("modcp_warninglogs_end");

	}

$plugins->run_hooks("modcp_warninglogs_end");

 

$filter_username = $mybb->input['filter']['username'];
$filter_modusername = $mybb->input['filter']['mod_username'];
$filter_reason = $mybb->input['filter']['reason'];


eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);


eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";");
output_page($warninglogs);

Zeile 3647Zeile 3651
	{
error_no_permission();
}

	{
error_no_permission();
}





	add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");


	add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");


 
	$ipsearch_results = $ipaddressvalue = '';

	$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
if($mybb->input['ipaddress'])
{

	$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
if($mybb->input['ipaddress'])
{

Zeile 3659Zeile 3664
		}

$ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);

		}

$ipaddressvalue = htmlspecialchars_uni($mybb->input['ipaddress']);





		$ip_range = fetch_ip_range($mybb->input['ipaddress']);

$post_results = $user_results = 0;

		$ip_range = fetch_ip_range($mybb->input['ipaddress']);

$post_results = $user_results = 0;

Zeile 3684Zeile 3689
			if($post_ip_sql)
{
$where_sql = '';

			if($post_ip_sql)
{
$where_sql = '';


$unviewable_forums = get_unviewable_forums(true);



$unviewable_forums = get_unviewable_forums(true);


				if($unviewable_forums)
{
$where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";

				if($unviewable_forums)
{
$where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";

Zeile 3835Zeile 3840
			}
}
$multipage = multipage($total_results, $perpage, $page, $page_url);

			}
}
$multipage = multipage($total_results, $perpage, $page, $page_url);





		$post_limit = $perpage;
$results = '';
if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
{
$query = $db->simple_select('users', 'username, uid, regip, lastip', $user_ip_sql,
array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit_start' => $start, 'limit' => $perpage));

		$post_limit = $perpage;
$results = '';
if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
{
$query = $db->simple_select('users', 'username, uid, regip, lastip', $user_ip_sql,
array('order_by' => 'regdate', 'order_dir' => 'DESC', 'limit_start' => $start, 'limit' => $perpage));


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


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

				$result = false;
$ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']);

				$result = false;
$ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
$profile_link = build_profile_link($ipaddress['username'], $ipaddress['uid']);

Zeile 3853Zeile 3858
				if(is_array($ip_range))
{
if(strcmp($ip_range[0], $ipaddress['regip']) <= 0 && strcmp($ip_range[1], $ipaddress['regip']) >= 0)

				if(is_array($ip_range))
{
if(strcmp($ip_range[0], $ipaddress['regip']) <= 0 && strcmp($ip_range[1], $ipaddress['regip']) >= 0)

					{

					{

						eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['regip']));

						eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['regip']));

					}

					}

					elseif(strcmp($ip_range[0], $ipaddress['lastip']) <= 0 && strcmp($ip_range[1], $ipaddress['lastip']) >= 0)
{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
}

					elseif(strcmp($ip_range[0], $ipaddress['lastip']) <= 0 && strcmp($ip_range[1], $ipaddress['lastip']) >= 0)
{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";");
$ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
}

				}

				}

				elseif($ipaddress['regip'] == $ip_range)
{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");

				elseif($ipaddress['regip'] == $ip_range)
{
eval("\$subject = \"".$templates->get("modcp_ipsearch_result_regip")."\";");

Zeile 3902Zeile 3907
				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}

				FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid)
WHERE {$post_ip_sql}{$where_sql}{$visible_sql}

				ORDER BY p.dateline desc

				ORDER BY p.dateline DESC, p.pid DESC

				LIMIT {$post_start}, {$post_limit}
");
while($ipaddress = $db->fetch_array($query))

				LIMIT {$post_start}, {$post_limit}
");
while($ipaddress = $db->fetch_array($query))

Zeile 3910Zeile 3915
				$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

				$tids[$ipaddress['tid']] = $ipaddress['pid'];
$uids[$ipaddress['uid']] = $ipaddress['pid'];
$ipaddresses[$ipaddress['pid']] = $ipaddress;

			}


			}


			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

			if(!empty($ipaddresses))
{
$query = $db->simple_select("threads", "subject, tid", "tid IN(".implode(',', array_keys($tids)).")");

Zeile 3958Zeile 3963
		}

if($ipaddressvalue)

		}

if($ipaddressvalue)

		{

		{

			$lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);
}
else

			$lang->ipsearch_results = $lang->sprintf($lang->ipsearch_results, $ipaddressvalue);
}
else

Zeile 3985Zeile 3990
	}
$usersearchselect = $postsearchselect = '';
if(isset($mybb->input['search_posts']))

	}
$usersearchselect = $postsearchselect = '';
if(isset($mybb->input['search_posts']))

	{

	{

		$postsearchselect = "checked=\"checked\"";
}
if(isset($mybb->input['search_users']))

		$postsearchselect = "checked=\"checked\"";
}
if(isset($mybb->input['search_users']))

Zeile 4002Zeile 4007
if($mybb->input['action'] == "iplookup")
{
if($mybb->usergroup['canuseipsearch'] == 0)

if($mybb->input['action'] == "iplookup")
{
if($mybb->usergroup['canuseipsearch'] == 0)

	{
error_no_permission();
}

	{
error_no_permission();
}


$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
$lang->ipaddress_misc_info = $lang->sprintf($lang->ipaddress_misc_info, htmlspecialchars_uni($mybb->input['ipaddress']));


$mybb->input['ipaddress'] = $mybb->get_input('ipaddress');
$lang->ipaddress_misc_info = $lang->sprintf($lang->ipaddress_misc_info, htmlspecialchars_uni($mybb->input['ipaddress']));

Zeile 4042Zeile 4047
	echo($iplookup);
exit;
}

	echo($iplookup);
exit;
}





if($mybb->input['action'] == "banning")
{
if($mybb->usergroup['canbanusers'] == 0)

if($mybb->input['action'] == "banning")
{
if($mybb->usergroup['canbanusers'] == 0)

Zeile 4060Zeile 4065
	// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];
if($mybb->get_input('page') != "last")

	// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['threadsperpage'];
if($mybb->get_input('page') != "last")

	{

	{

		$page = $mybb->get_input('page', MyBB::INPUT_INT);
}


		$page = $mybb->get_input('page', MyBB::INPUT_INT);
}


Zeile 4206Zeile 4211

// Permission to edit this ban?
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)


// Permission to edit this ban?
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

	{
error_no_permission();
}


	{
error_no_permission();
}


	$plugins->run_hooks("modcp_liftban_start");

$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");

	$plugins->run_hooks("modcp_liftban_start");

$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");

Zeile 4217Zeile 4222

$updated_group = array(
'usergroup' => $ban['oldgroup'],


$updated_group = array(
'usergroup' => $ban['oldgroup'],

		'additionalgroups' => $ban['oldadditionalgroups'],

		'additionalgroups' => $db->escape_string($ban['oldadditionalgroups']),

		'displaygroup' => $ban['olddisplaygroup']
);
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
$db->delete_query("banned", "uid='{$ban['uid']}'");


		'displaygroup' => $ban['olddisplaygroup']
);
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
$db->delete_query("banned", "uid='{$ban['uid']}'");


	$cache->update_banned();

 
	$cache->update_moderators();
log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);


	$cache->update_moderators();
log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);


Zeile 4243Zeile 4247
	}

// Editing an existing ban

	}

// Editing an existing ban

 
	$existing_ban = false;

	if($mybb->get_input('uid', MyBB::INPUT_INT))
{
// Get the users info from their uid

	if($mybb->get_input('uid', MyBB::INPUT_INT))
{
// Get the users info from their uid

Zeile 4254Zeile 4259
		");
$user = $db->fetch_array($query);


		");
$user = $db->fetch_array($query);


		$existing_ban = false;

 
		if($user['uid'])
{
$existing_ban = true;

		if($user['uid'])
{
$existing_ban = true;

		}


		}


		// Permission to edit this ban?
if($existing_ban && $mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
{
error_no_permission();
}
}

		// Permission to edit this ban?
if($existing_ban && $mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
{
error_no_permission();
}
}

 

$errors = array();


// Creating a new ban
if(!$existing_ban)


// Creating a new ban
if(!$existing_ban)

Zeile 4286Zeile 4292
	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	if($user['uid'] == $mybb->user['uid'])
{
$errors[] = $lang->error_cannotbanself;

	}

	}


// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))


// Have permissions to ban this user?
if(!modcp_can_manage_user($user['uid']))

Zeile 4312Zeile 4318
	// If this is a new ban, we check the user isn't already part of a banned group
if(!$existing_ban && $user['uid'])
{

	// If this is a new ban, we check the user isn't already part of a banned group
if(!$existing_ban && $user['uid'])
{

		$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'");
if($db->fetch_field($query, "uid"))

		$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'", array('limit' => 1));
if($db->num_rows($query) > 0)

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

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

Zeile 4358Zeile 4364
				'uid' => $user['uid'],
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'oldgroup' => (int)$user['usergroup'],

				'uid' => $user['uid'],
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'oldgroup' => (int)$user['usergroup'],

				'oldadditionalgroups' => (string)$user['additionalgroups'],

				'oldadditionalgroups' => $db->escape_string($user['additionalgroups']),

				'olddisplaygroup' => (int)$user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,

				'olddisplaygroup' => (int)$user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,

Zeile 4377Zeile 4383
			'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$user['uid']}");

			'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = {$user['uid']}");


$cache->update_banned();

 

// Log edit or add ban
if($existing_ban)


// Log edit or add ban
if($existing_ban)

Zeile 4442Zeile 4446
			WHERE b.uid='{$mybb->input['uid']}'
");
$banned = $db->fetch_array($query);

			WHERE b.uid='{$mybb->input['uid']}'
");
$banned = $db->fetch_array($query);

		if($banned['username'])

		if(!empty($banned['username']))

		{
$username = $banned['username'] = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);

		{
$username = $banned['username'] = htmlspecialchars_uni($banned['username']);
$banreason = htmlspecialchars_uni($banned['reason']);

Zeile 4454Zeile 4458
	}

// Permission to edit this ban?

	}

// Permission to edit this ban?

	if($banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

	if(!empty($banned) && $banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 4516Zeile 4520
	$bangroup_option = $bangroups = '';
$numgroups = $banned_group = 0;
$groupscache = $cache->read("usergroups");

	$bangroup_option = $bangroups = '';
$numgroups = $banned_group = 0;
$groupscache = $cache->read("usergroups");





	foreach($groupscache as $key => $group)
{
if($group['isbannedgroup'])

	foreach($groupscache as $key => $group)
{
if($group['isbannedgroup'])

Zeile 4654Zeile 4658
					FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid

					FROM  ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid

					ORDER BY p.dateline DESC

					ORDER BY p.dateline DESC, p.pid DESC

					LIMIT 1
");
$post = $db->fetch_array($query);

					LIMIT 1
");
$post = $db->fetch_array($query);

Zeile 4666Zeile 4670
				if(my_strlen($post['subject']) > 25)
{
$post['subject'] = my_substr($post['subject'], 0, 25)."...";

				if(my_strlen($post['subject']) > 25)
{
$post['subject'] = my_substr($post['subject'], 0, 25)."...";

				}

				}

				$post['subject'] = htmlspecialchars_uni($post['subject']);
$post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);
$unapproved_posts = my_number_format($unapproved_posts);

				$post['subject'] = htmlspecialchars_uni($post['subject']);
$post['fullsubject'] = htmlspecialchars_uni($post['fullsubject']);
$unapproved_posts = my_number_format($unapproved_posts);

Zeile 4725Zeile 4729
		$where = '';
if($tflist_modlog)
{

		$where = '';
if($tflist_modlog)
{

			$where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (!l.fid)";

			$where = "WHERE (t.fid <> 0 {$tflist_modlog}) OR (l.fid <> 0)";

		}

$query = $db->query("

		}

$query = $db->query("

Zeile 4774Zeile 4778
			if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
{
$data = my_unserialize($logitem['data']);

			if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
{
$data = my_unserialize($logitem['data']);

				if($data['uid'])

				if(isset($data['uid']))

				{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

				{
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}

				if($data['aid'])

				if(isset($data['aid']))

				{
$data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
$data['announcement'] = get_announcement_link($data['aid']);

				{
$data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject']));
$data['announcement'] = get_announcement_link($data['aid']);

Zeile 4893Zeile 4897
		eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";");
}


		eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";");
}


	$modnotes = $cache->read("modnotes");
$modnotes = htmlspecialchars_uni($modnotes['modmessage']);





	$modnotes = '';
$modnotes_cache = $cache->read("modnotes");
if($modnotes_cache !== false)
{
$modnotes = htmlspecialchars_uni($modnotes_cache['modmessage']);
}


$plugins->run_hooks("modcp_end");



$plugins->run_hooks("modcp_end");