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

  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 988Zeile 995
		if(!my_validate_url($user['avatar']))
{
$user['avatar'] = "../{$user['avatar']}\n";

		if(!my_validate_url($user['avatar']))
{
$user['avatar'] = "../{$user['avatar']}\n";

		}
}

		}
}

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

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

Zeile 1017Zeile 1024
	$reg_date = my_date('relative', $user['regdate']);
if($user['dst'] == 1)
{

	$reg_date = my_date('relative', $user['regdate']);
if($user['dst'] == 1)
{

		$timezone = $user['timezone']+1;

		$timezone = (float)$user['timezone']+1;

	}
else
{

	}
else
{

		$timezone = $user['timezone'];

		$timezone = (float)$user['timezone'];

	}
$local_date = gmdate($mybb->settings['dateformat'], TIME_NOW + ($timezone * 3600));
$local_time = gmdate($mybb->settings['timeformat'], TIME_NOW + ($timezone * 3600));

	}
$local_date = gmdate($mybb->settings['dateformat'], TIME_NOW + ($timezone * 3600));
$local_time = gmdate($mybb->settings['timeformat'], TIME_NOW + ($timezone * 3600));

Zeile 1030Zeile 1037
	$days_registered = (TIME_NOW - $user['regdate']) / (24*3600);
$posts_per_day = 0;
if($days_registered > 0)

	$days_registered = (TIME_NOW - $user['regdate']) / (24*3600);
$posts_per_day = 0;
if($days_registered > 0)

	{

	{

		$posts_per_day = round($user['postnum'] / $days_registered, 2);
if($posts_per_day > $user['postnum'])
{

		$posts_per_day = round($user['postnum'] / $days_registered, 2);
if($posts_per_day > $user['postnum'])
{

Zeile 1048Zeile 1055
	else
{
$percent_posts = round($user['postnum']*100/$posts, 2);

	else
{
$percent_posts = round($user['postnum']*100/$posts, 2);

	}


	}


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

// Fetch the reputation for this user

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

// Fetch the reputation for this user

Zeile 1067Zeile 1074
		if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

		if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

		}


		}


		$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)
{

		$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)
{

Zeile 1081Zeile 1088
	if($user['birthday'])
{
$age = get_age($user['birthday']);

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

	}

	}


$postnum = my_number_format($user['postnum']);



$postnum = my_number_format($user['postnum']);


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


Zeile 2714Zeile 2724
					{
// No errors, so let's continue and set the date to delete from
$date = mktime(date('H'), date('i'), date('s'), $month, $day, $year); // Generate a unix time stamp

					{
// No errors, so let's continue and set the date to delete from
$date = mktime(date('H'), date('i'), date('s'), $month, $day, $year); // Generate a unix time stamp

					}

					}

				}
elseif($mybb->input['set'] > 0)
{
// Set options
// For this purpose, 1 month = 31 days
$base_time = 24 * 60 * 60;

				}
elseif($mybb->input['set'] > 0)
{
// Set options
// For this purpose, 1 month = 31 days
$base_time = 24 * 60 * 60;





					switch($mybb->input['set'])
{
case '1':

					switch($mybb->input['set'])
{
case '1':

Zeile 2753Zeile 2763
					{
$date = TIME_NOW - $threshold;
}

					{
$date = TIME_NOW - $threshold;
}

				}

				}

				else
{
$errors[] = $lang->no_prune_option;

				else
{
$errors[] = $lang->no_prune_option;

Zeile 2765Zeile 2775
					$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))

					$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))

					{

					{

						// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
{

						// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
{

Zeile 2917Zeile 2927
					}

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

					}

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

				}
else

				}
else

				{
$additionalgroups = '';
}

				{
$additionalgroups = '';
}

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

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

	}

$results = build_users_view($admin_view);


	}

$results = build_users_view($admin_view);


	if(!$results)
{
// If we came from the home page and clicked on the "Activate Users" link, send them back to here

	if(!$results)
{
// If we came from the home page and clicked on the "Activate Users" link, send them back to here

Zeile 3084Zeile 3094
			exit;
}
else

			exit;
}
else

		{

		{

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

// If we have any error messages, show them
if($errors)

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

// If we have any error messages, show them
if($errors)

	{

	{

		if($inline != true)
{
echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n";
}
$page->output_inline_error($errors);

		if($inline != true)
{
echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n";
}
$page->output_inline_error($errors);

	}


	}


	echo $results;

$page->output_footer();
}

	echo $results;

$page->output_footer();
}





/**
* @param array $view
*

/**
* @param array $view
*

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