Vergleich modcp.php - 1.8.31 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 2064Zeile 2064
	{
$attachments = array_map("intval", array_keys($mybb->input['attachments']));
$query = $db->query("

	{
$attachments = array_map("intval", array_keys($mybb->input['attachments']));
$query = $db->query("

			SELECT a.pid, a.aid

			SELECT a.pid, a.aid, t.tid

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			FROM  ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

Zeile 2080Zeile 2080
			if($action == "approve")
{
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");

			if($action == "approve")
{
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");

 
				if(isset($attachment['tid']))
{
update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "+1"));
}

			}
else if($action == "delete")
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

			}
else if($action == "delete")
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

 
				if(isset($attachment['tid']))
{
update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "-1"));
}

			}
}


			}
}


Zeile 2635Zeile 2643
				"update_field" => "suspendposting",
"update_length" => "suspensiontime"
)

				"update_field" => "suspendposting",
"update_length" => "suspensiontime"
)

		);

		);


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)

Zeile 2649Zeile 2657
					// We're revoking the suspension
$extra_user_updates[$option['update_field']] = 0;
$extra_user_updates[$option['update_length']] = 0;

					// We're revoking the suspension
$extra_user_updates[$option['update_field']] = 0;
$extra_user_updates[$option['update_length']] = 0;

				}

				}


// Skip this option if we haven't selected it
continue;


// Skip this option if we haven't selected it
continue;

Zeile 2670Zeile 2678
					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time

					if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never"))
{
// We already have a suspension, but entered a new time

						if($suspend_length == "-1")

						if($suspend_length == "-1")

						{
// Permanent ban on action
$extra_user_updates[$option['update_length']] = 0;

						{
// Permanent ban on action
$extra_user_updates[$option['update_length']] = 0;

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

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

	}


	}


	if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);

	if(!$errors)
{
$mybb->input = array_merge($user, $mybb->input);

Zeile 2788Zeile 2796
			$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
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

	}

	}


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


// Sanitize all input
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));
}


Zeile 2809Zeile 2817
	{
// Go for post count title if a group default isn't set
$usertitles = $cache->read('usertitles');

	{
// Go for post count title if a group default isn't set
$usertitles = $cache->read('usertitles');





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

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

Zeile 2817Zeile 2825
				$defaulttitle = htmlspecialchars_uni($title['title']);
break;
}

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

		}
}


		}
}


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

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

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

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

	{

	{

		$lang->current_custom_usertitle = '';
}


		$lang->current_custom_usertitle = '';
}


Zeile 2831Zeile 2839
	for($day = 1; $day <= 31; ++$day)
{
if($mybb->input['birthday_day'] == $day)

	for($day = 1; $day <= 31; ++$day)
{
if($mybb->input['birthday_day'] == $day)

		{

		{

			$selected = "selected=\"selected\"";
}
else

			$selected = "selected=\"selected\"";
}
else

Zeile 2844Zeile 2852

$bdaymonthsel = array();
foreach(range(1, 12) as $month)


$bdaymonthsel = array();
foreach(range(1, 12) as $month)

	{

	{

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

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

 

$awaysection = '';


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


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

Zeile 2912Zeile 2922
		if(!isset($returndate[2]))
{
$returndate[2] = '';

		if(!isset($returndate[2]))
{
$returndate[2] = '';

		}


		}


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


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


Zeile 2961Zeile 2971
				$userfield = $user_fields[$field];
}
if($type == "multiselect")

				$userfield = $user_fields[$field];
}
if($type == "multiselect")

			{
if($errors)
{
$useropts = $userfield;
}
else
{
$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

			{
if($errors)
{
$useropts = $userfield;
}
else
{
$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])


$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])

						{
$sel = " selected=\"selected\"";
}

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

						{
$sel = " selected=\"selected\"";
}

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

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

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

Zeile 3017Zeile 3027
						}

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

						}

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

					}
if(!$profilefield['length'])

					}
if(!$profilefield['length'])

					{
$profilefield['length'] = 1;
}

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

					{
$profilefield['length'] = 1;
}

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

				}

				}

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

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

Zeile 3048Zeile 3058
				if($errors)
{
$useropts = $userfield;

				if($errors)
{
$useropts = $userfield;

				}
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 3120Zeile 3130
	{
$checked = 1;
$checked_item = "checked=\"checked\"";

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

	}
else
{

	}
else
{

		$checked = 0;
$checked_item = '';
}

		$checked = 0;
$checked_item = '';
}

Zeile 3191Zeile 3201
		${$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']])

		${$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']])

		{

		{

			if($user[$option['length']] == 0)
{
// User has a permanent ban

			if($user[$option['length']] == 0)
{
// User has a permanent ban

Zeile 3672Zeile 3682
		// Searching post IP addresses
if(isset($mybb->input['search_posts']))
{

		// Searching post IP addresses
if(isset($mybb->input['search_posts']))
{

 
			$post_ip_sql = '';

			if($ip_range)
{
if(!is_array($ip_range))

			if($ip_range)
{
if(!is_array($ip_range))

Zeile 3745Zeile 3756
					if(!empty($deleted_forums))
{
$visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))";

					if(!empty($deleted_forums))
{
$visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))";

					}
}
else

					}
}
else

				{
// Super moderators (and admins)
$visible_sql = " AND p.visible >= -1";

				{
// Super moderators (and admins)
$visible_sql = " AND p.visible >= -1";

Zeile 3766Zeile 3777
		// Searching user IP addresses
if(isset($mybb->input['search_users']))
{

		// Searching user IP addresses
if(isset($mybb->input['search_users']))
{

 
			$user_ip_sql = '';

			if($ip_range)
{
if(!is_array($ip_range))

			if($ip_range)
{
if(!is_array($ip_range))

Zeile 3936Zeile 3948
				foreach($ipaddresses as $ipaddress)
{
$ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));

				foreach($ipaddresses as $ipaddress)
{
$ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));

					if(!$ipaddress['username'])

					if(empty($ipaddress['username']))

					{
$ipaddress['username'] = $ipaddress['postusername']; // Guest username support
}
$ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
$trow = alt_trow();

					{
$ipaddress['username'] = $ipaddress['postusername']; // Guest username support
}
$ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']);
$trow = alt_trow();

					if(!$ipaddress['subject'])

					if(empty($ipaddress['subject']))

					{
$ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}";
}

					{
$ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}";
}

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


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


		if($user['uid'])

		if($user)

		{
$existing_ban = true;
}

		{
$existing_ban = true;
}

Zeile 4283Zeile 4295

$user = get_user_by_username($mybb->input['username'], $options);



$user = get_user_by_username($mybb->input['username'], $options);


		if(!$user['uid'])

		if(!$user)

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

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

Zeile 4308Zeile 4320

// Check banned group
$usergroups_cache = $cache->read('usergroups');


// Check banned group
$usergroups_cache = $cache->read('usergroups');

	$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];




	if(isset($usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)]))
{
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];
}





	if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup']))

	if(!isset($usergroup) || empty($usergroup['isbannedgroup']))

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

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