Vergleich modcp.php - 1.8.16 - 1.8.23

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 2587Zeile 2587
		"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'),

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

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

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

Zeile 2617Zeile 2616

// 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 2671Zeile 2670
			if(empty($mybb->input[$option['action']]))
{
if($user[$option['update_field']] == 1)

			if(empty($mybb->input[$option['action']]))
{
if($user[$option['update_field']] == 1)

				{

				{

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

Zeile 2684Zeile 2683
			else
{
if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

			else
{
if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)

				{

				{

					// User has selected a type of ban, but not entered a valid time frame
$string = $option['action']."_error";
$errors[] = $lang->$string;
}

					// User has selected a type of ban, but not entered a valid time frame
$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 2700Zeile 2698
						if($suspend_length == "-1")
{
// Permanent ban on action

						if($suspend_length == "-1")
{
// Permanent ban on action

							$extra_user_updates[$option['update_length']] = 0;

							$extra_user_updates[$option['update_length']] = 0;

						}
elseif($suspend_length && $suspend_length != "-1")
{

						}
elseif($suspend_length && $suspend_length != "-1")
{

Zeile 2732Zeile 2730
			$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 2780Zeile 2778

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


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

	$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{

Zeile 2807Zeile 2811
		if(!isset($birthday[2]))
{
$birthday[2] = '';

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

		}

		}

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

		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

	// Sanitize all input

	foreach(array('usertitle', 'website', 'icq', '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
if(!empty($userperms['usertitle']))
{
$defaulttitle = htmlspecialchars_uni($userperms['usertitle']);


// Custom user title
if(!empty($userperms['usertitle']))
{
$defaulttitle = htmlspecialchars_uni($userperms['usertitle']);

	}

	}

	else
{
// Go for post count title if a group default isn't set

	else
{
// Go for post count title if a group default isn't set

Zeile 2836Zeile 2840
			if($title['posts'] <= $user['postnum'])
{
$defaulttitle = $title['title'];

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

				break;
}
}
}

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


				break;
}
}
}

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


	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

	if(empty($user['usertitle']))
{
$lang->current_custom_usertitle = '';

Zeile 2897Zeile 2901
				$awaydate = my_date($mybb->settings['dateformat'], $user['awaydate']);
$awaycheck[1] = "checked=\"checked\"";
$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);

				$awaydate = my_date($mybb->settings['dateformat'], $user['awaydate']);
$awaycheck[1] = "checked=\"checked\"";
$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);

			}
else

			}
else

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

Zeile 3004Zeile 3008

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

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

Zeile 3063Zeile 3067
			elseif($type == "checkbox")
{
if($errors)

			elseif($type == "checkbox")
{
if($errors)

				{

				{

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

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

				}

				}

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

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

					{

					{

						$seloptions[$val] = $val;

						$seloptions[$val] = $val;

					}
}

					}
}

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

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

Zeile 3090Zeile 3094

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


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

				}
}

				}
}

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");

			}
else
{

			}
else
{

				$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)
{
$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}

				$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)
{
$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}





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

if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

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

if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

			}

			}

			else
{
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
$altbg = alt_trow();

			else
{
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");
}
$altbg = alt_trow();

		}
}

		}
}

	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

	if($customfields)
{
eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");

Zeile 3230Zeile 3234
					break;
case "moderateposts":
eval("\$moderateposts_info = \"".$templates->get("modcp_editprofile_suspensions_info")."\";");

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

					break;

					break;

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

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

Zeile 3283Zeile 3287
	$user_icq = $mybb->input['icq'];
$user_skype = $mybb->input['skype'];
$user_google = $mybb->input['google'];

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

	$user_yahoo = $mybb->input['yahoo'];

 

$plugins->run_hooks("modcp_editprofile_end");


$plugins->run_hooks("modcp_editprofile_end");





	eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
output_page($edituser);
}

	eval("\$edituser = \"".$templates->get("modcp_editprofile")."\";");
output_page($edituser);
}





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

if($mybb->input['action'] == "finduser")
{
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 3314Zeile 3317
			case 'mysql':
case 'mysqli':
$field = 'username';

			case 'mysql':
case 'mysqli':
$field = 'username';

				break;

				break;

			default:
$field = 'LOWER(username)';
break;

			default:
$field = 'LOWER(username)';
break;

Zeile 3369Zeile 3372
		$page = 1;
}
if($page)

		$page = 1;
}
if($page)

	{

	{

		$start = ($page-1) * $perpage;
}
else

		$start = ($page-1) * $perpage;
}
else

	{

	{

		$start = 0;
$page = 1;

		$start = 0;
$page = 1;

	}

	}


$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)


$page_url = 'modcp.php?action=finduser';
foreach(array('username', 'sortby', 'order') as $field)

Zeile 3390Zeile 3393
	$multipage = multipage($user_count, $perpage, $page, $page_url);

$usergroups_cache = $cache->read("usergroups");

	$multipage = multipage($user_count, $perpage, $page, $page_url);

$usergroups_cache = $cache->read("usergroups");





	$plugins->run_hooks("modcp_finduser_start");

// Fetch out results
$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));
$users = '';
while($user = $db->fetch_array($query))

	$plugins->run_hooks("modcp_finduser_start");

// Fetch out results
$query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start));
$users = '';
while($user = $db->fetch_array($query))

	{

	{

		$alt_row = alt_trow();
$user['username'] = htmlspecialchars_uni($user['username']);
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

		$alt_row = alt_trow();
$user['username'] = htmlspecialchars_uni($user['username']);
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

Zeile 3418Zeile 3421
		{
$lastdate = my_date('relative', $user['lastvisit']);
}

		{
$lastdate = my_date('relative', $user['lastvisit']);
}





		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}

// No results?
if(!$users)

		$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
eval("\$users .= \"".$templates->get("modcp_finduser_user")."\";");
}

// No results?
if(!$users)

	{

	{

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

$plugins->run_hooks("modcp_finduser_end");


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

$plugins->run_hooks("modcp_finduser_end");


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

	$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 3480Zeile 3483

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


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

	}
else

	}
else

	{
$mybb->input['filter']['mod_username'] = '';
}

	{
$mybb->input['filter']['mod_username'] = '';
}

Zeile 3494Zeile 3497
			$mod_user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
}

			$mod_user = get_user($mybb->input['search']['uid']);
$mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
}

	}
else

	}
else

	{
$mybb->input['filter']['mod_uid'] = '';

	{
$mybb->input['filter']['mod_uid'] = '';

	}

	}

	if(!empty($mybb->input['filter']['reason']))
{
$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);

	if(!empty($mybb->input['filter']['reason']))
{
$search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']);

Zeile 3508Zeile 3511
	else
{
$mybb->input['filter']['reason'] = '';

	else
{
$mybb->input['filter']['reason'] = '';

	}

	}

	$sortbysel = array('username' => '', 'expires' => '', 'issuedby' => '', 'dateline' => '');
if(!isset($mybb->input['filter']['sortby']))
{

	$sortbysel = array('username' => '', 'expires' => '', 'issuedby' => '', 'dateline' => '');
if(!isset($mybb->input['filter']['sortby']))
{

Zeile 3563Zeile 3566
	$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;
}

	{
$page = 1;
}

	$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)

	$per_page = 20;
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0)

	{

	{

		$per_page = (int)$mybb->input['filter']['per_page'];

		$per_page = (int)$mybb->input['filter']['per_page'];

	}

	}

	$start = ($page-1) * $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 4173Zeile 4182
				$banned_class = "high_banned";
}
else if($remaining < 86400)

				$banned_class = "high_banned";
}
else if($remaining < 86400)

			{

			{

				$banned_class = "moderate_banned";
}
else if($remaining < 604800)
{
$banned_class = "low_banned";

				$banned_class = "moderate_banned";
}
else if($remaining < 604800)
{
$banned_class = "low_banned";

			}

			}

			else
{
$banned_class = "normal_banned";

			else
{
$banned_class = "normal_banned";

Zeile 4189Zeile 4198
		}

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

		}

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

	}

	}


if(!$bannedusers)
{


if(!$bannedusers)
{

Zeile 4200Zeile 4209

eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";");
output_page($bannedpage);


eval("\$bannedpage = \"".$templates->get("modcp_banning")."\";");
output_page($bannedpage);

}


}


if($mybb->input['action'] == "liftban")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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

if($mybb->input['action'] == "liftban")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 4218Zeile 4227
	if(!$ban)
{
error($lang->error_invalidban);

	if(!$ban)
{
error($lang->error_invalidban);

	}


	}


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

Zeile 4229Zeile 4238
	$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']}'");

	$username = $db->fetch_field($query, "username");

	$username = $db->fetch_field($query, "username");


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


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

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

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





	$plugins->run_hooks("modcp_liftban_end");

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

	$plugins->run_hooks("modcp_liftban_end");

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

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

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





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

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

	}


	}


	// Editing an existing ban
if($mybb->get_input('uid', MyBB::INPUT_INT))
{

	// Editing an existing ban
if($mybb->get_input('uid', MyBB::INPUT_INT))
{

Zeile 4395Zeile 4403
			'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)