Vergleich admin/modules/user/users.php - 1.8.8 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 627Zeile 627
			// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{

			// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{

				if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false)

				if(!$mybb->settings['allowremoteavatars'])

				{

				{

					// Gravatar
$email = md5(strtolower(trim($mybb->input['avatar_url'])));

$s = '';
if(!$mybb->settings['maxavatardims'])
{
$mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits
}

// Because Gravatars are square, hijack the width
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;

$extra_user_updates = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

					$errors = array($lang->error_remote_avatar_not_allowed);




















				}
else
{

				}
else
{

					$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);
$ext = get_extension($mybb->input['avatar_url']);

// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatar_url']);
if(!$file)

					if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false)






					{

					{

						$avatar_error = $lang->error_invalidavatarurl;




















						// Gravatar
$email = md5(strtolower(trim($mybb->input['avatar_url'])));

$s = '';
if(!$mybb->settings['maxavatardims'])
{
$mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits
}

// Because Gravatars are square, hijack the width
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;

$extra_user_updates = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

					}
else
{

					}
else
{

						$tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(random_str());
$fp = @fopen($tmp_name, "wb");
if(!$fp)
{




						$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);
$ext = get_extension($mybb->input['avatar_url']);

// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatar_url']);
if(!$file)
{

							$avatar_error = $lang->error_invalidavatarurl;

							$avatar_error = $lang->error_invalidavatarurl;

						}
else
{
fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);
@unlink($tmp_name);
echo $type;
if(!$type)
{

						}
else
{
$tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(random_str());
$fp = @fopen($tmp_name, "wb");
if(!$fp)
{




								$avatar_error = $lang->error_invalidavatarurl;

								$avatar_error = $lang->error_invalidavatarurl;

 
							}
else
{
fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);
@unlink($tmp_name);
echo $type;
if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;
}
}
}

if(empty($avatar_error))
{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;
}

							}
}

							}
}

					}

 




					if(empty($avatar_error))
{
if($width && $height && $mybb->settings['maxavatardims'] != "")

						if(empty($avatar_error))



						{

						{

							list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))

							if($width > 0 && $height > 0)


							{

							{

								$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;

								$avatar_dimensions = (int)$width."|".(int)$height;


							}

							}

						}
}

if(empty($avatar_error))
{
if($width > 0 && $height > 0)



							$extra_user_updates = array(
"avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
remove_avatars($user['uid']);
}
else

						{

						{

							$avatar_dimensions = (int)$width."|".(int)$height;

							$errors = array($avatar_error);

						}

						}

						$extra_user_updates = array(
"avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
remove_avatars($user['uid']);
}
else
{
$errors = array($avatar_error);

 
					}
}
}

					}
}
}

Zeile 874Zeile 881
		$mybb->input['bday'][0] = $mybb->input['bday1'];
$mybb->input['bday'][1] = $mybb->input['bday2'];
$mybb->input['bday'][2] = $mybb->get_input('bday3', MyBB::INPUT_INT);

		$mybb->input['bday'][0] = $mybb->input['bday1'];
$mybb->input['bday'][1] = $mybb->input['bday2'];
$mybb->input['bday'][2] = $mybb->get_input('bday3', MyBB::INPUT_INT);

	}

	}

	else
{
$mybb->input['bday'] = array(0, 0, '');

	else
{
$mybb->input['bday'] = array(0, 0, '');

Zeile 970Zeile 977

// Avatar
$avatar_dimensions = explode("|", $user['avatardimensions']);


// Avatar
$avatar_dimensions = explode("|", $user['avatardimensions']);

	if($user['avatar'])

	if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))

	{
if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";
list($width, $height) = explode("|", $user['avatardimensions']);
$scaled_dimensions = scale_image($width, $height, 120, 120);

	{
if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";
list($width, $height) = explode("|", $user['avatardimensions']);
$scaled_dimensions = scale_image($width, $height, 120, 120);

		}

		}

		else
{
$scaled_dimensions = array(

		else
{
$scaled_dimensions = array(

Zeile 1079Zeile 1086

$age = $lang->na;
if($user['birthday'])


$age = $lang->na;
if($user['birthday'])

	{

	{

		$age = get_age($user['birthday']);
}


		$age = get_age($user['birthday']);
}


Zeile 1533Zeile 1540
	}
$form_container = new FormContainer($lang->specify_custom_avatar);
$form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');

	}
$form_container = new FormContainer($lang->specify_custom_avatar);
$form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');

	$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');




	if($mybb->settings['allowremoteavatars'])
{
$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');
}

	$form_container->end();
echo "</div>\n";

	$form_container->end();
echo "</div>\n";





	//
// MODERATOR OPTIONS
//

	//
// MODERATOR OPTIONS
//

Zeile 1565Zeile 1575
		{
$remaining = $user['moderationtime']-TIME_NOW;
$expired = nice_time($remaining, array('seconds' => false));

		{
$remaining = $user['moderationtime']-TIME_NOW;
$expired = nice_time($remaining, array('seconds' => false));


$color = 'inherit';
if($remaining < 3600)
{
$color = 'red';
}
elseif($remaining < 86400)
{
$color = 'maroon';
}
elseif($remaining < 604800)
{
$color = 'green';
}



$color = 'inherit';
if($remaining < 3600)
{
$color = 'red';
}
elseif($remaining < 86400)
{
$color = 'maroon';
}
elseif($remaining < 604800)
{
$color = 'green';
}


			$existing_info = $lang->sprintf($lang->moderate_length, $expired, $color);
}
else

			$existing_info = $lang->sprintf($lang->moderate_length, $expired, $color);
}
else

Zeile 1670Zeile 1680
		if($("#suspendposting").is(":checked") == true)
{
$("#suspost").show();

		if($("#suspendposting").is(":checked") == true)
{
$("#suspost").show();

		}

		}

		else if($("#suspendposting").is(":checked") == false)
{
$("#suspost").hide();

		else if($("#suspendposting").is(":checked") == false)
{
$("#suspost").hide();

Zeile 1760Zeile 1770
if($mybb->input['action'] == "referrers")
{
$page->add_breadcrumb_item($lang->show_referrers);

if($mybb->input['action'] == "referrers")
{
$page->add_breadcrumb_item($lang->show_referrers);

	$page->output_header($lang->show_referrers);


	$page->output_header($lang->show_referrers);


	$sub_tabs['referrers'] = array(
'title' => $lang->show_referrers,
'link' => "index.php?module=user-users&amp;action=referrers&amp;uid={$mybb->input['uid']}",

	$sub_tabs['referrers'] = array(
'title' => $lang->show_referrers,
'link' => "index.php?module=user-users&amp;action=referrers&amp;uid={$mybb->input['uid']}",

Zeile 1775Zeile 1785
	// Fetch default admin view
$default_view = fetch_default_view("user");
if(!$default_view)

	// Fetch default admin view
$default_view = fetch_default_view("user");
if(!$default_view)

	{

	{

		$default_view = "0";
}
$query = $db->simple_select("adminviews", "*", "type='user' AND (vid='{$default_view}' OR uid=0)", array("order_by" => "uid", "order_dir" => "desc"));
$admin_view = $db->fetch_array($query);

		$default_view = "0";
}
$query = $db->simple_select("adminviews", "*", "type='user' AND (vid='{$default_view}' OR uid=0)", array("order_by" => "uid", "order_dir" => "desc"));
$admin_view = $db->fetch_array($query);





	if($mybb->input['type'])
{
$admin_view['view_type'] = $mybb->input['type'];

	if($mybb->input['type'])
{
$admin_view['view_type'] = $mybb->input['type'];

Zeile 1802Zeile 1812
	else
{
echo $view;

	else
{
echo $view;

	}

$page->output_footer();
}


	}

$page->output_footer();
}


if($mybb->input['action'] == "ipaddresses")
{
$page->add_breadcrumb_item($lang->ip_addresses);

if($mybb->input['action'] == "ipaddresses")
{
$page->add_breadcrumb_item($lang->ip_addresses);

Zeile 1824Zeile 1834

$query = $db->simple_select("users", "uid, regip, username, lastip", "uid='{$mybb->input['uid']}'", array('limit' => 1));
$user = $db->fetch_array($query);


$query = $db->simple_select("users", "uid, regip, username, lastip", "uid='{$mybb->input['uid']}'", array('limit' => 1));
$user = $db->fetch_array($query);





	// Log admin action
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));

$table = new Table;

	// Log admin action
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));

$table = new Table;





	$table->construct_header($lang->ip_address);
$table->construct_header($lang->controls, array('width' => 200, 'class' => "align_center"));


	$table->construct_header($lang->ip_address);
$table->construct_header($lang->controls, array('width' => 200, 'class' => "align_center"));


Zeile 1850Zeile 1860
		$controls = $popup->fetch();
}
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".$user['lastip']);

		$controls = $popup->fetch();
}
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".$user['lastip']);

	$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();


	$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();


	if(empty($user['regip']))
{
$user['regip'] = $lang->unknown;

	if(empty($user['regip']))
{
$user['regip'] = $lang->unknown;

Zeile 1892Zeile 1902
	}

$table->output($lang->ip_address_for.' '.htmlspecialchars_uni($user['username']));

	}

$table->output($lang->ip_address_for.' '.htmlspecialchars_uni($user['username']));





	$page->output_footer();
}

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

	$page->output_footer();
}

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

{

{

	$plugins->run_hooks("admin_user_users_merge");

if($mybb->request_method == "post")

	$plugins->run_hooks("admin_user_users_merge");

if($mybb->request_method == "post")

Zeile 2099Zeile 2109
			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

			);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");


			);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");


			// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
$num = $db->fetch_array($query);

			// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
$num = $db->fetch_array($query);

Zeile 2305Zeile 2315
		$results = build_users_view($admin_view);

if($results)

		$results = build_users_view($admin_view);

if($results)

		{

		{

			$page->output_header($lang->find_users);
echo "<script type=\"text/javascript\" src=\"jscripts/users.js\"></script>";
$page->output_nav_tabs($sub_tabs, 'find_users');

			$page->output_header($lang->find_users);
echo "<script type=\"text/javascript\" src=\"jscripts/users.js\"></script>";
$page->output_nav_tabs($sub_tabs, 'find_users');

Zeile 3122Zeile 3132
	if($view['title'])
{
$title_string = "view_title_{$view['vid']}";

	if($view['title'])
{
$title_string = "view_title_{$view['vid']}";





		if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

		if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

Zeile 3606Zeile 3616
			{
$scaled_avatar = fetch_scaled_avatar($user, 34, 34);
}

			{
$scaled_avatar = fetch_scaled_avatar($user, 34, 34);
}

			if(!$user['avatar'])

			if(!$user['avatar'] || (my_strpos($user['avatar'], '://') !== false && !$mybb->settings['allowremoteavatars']))

			{
if(my_validate_url($mybb->settings['useravatar']))
{

			{
if(my_validate_url($mybb->settings['useravatar']))
{

Zeile 3939Zeile 3949
		"height" => $max_height,
);


		"height" => $max_height,
);


	if($user['avatar'])



	global $mybb;

if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))

	{
if($user['avatardimensions'])
{

	{
if($user['avatardimensions'])
{