Vergleich admin/modules/user/users.php - 1.4.0 - 1.4.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: users.php 4054 2008-07-31 05:19:05Z Tikitiki $

 * $Id: users.php 5379 2011-02-21 11:06:42Z Tomm $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 159Zeile 159
	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

 
		$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);

		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);

Zeile 175Zeile 177
			// Log admin action
log_admin_action($user['uid'], $user['username']);
}

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

		remove_avatars($mybb->user['uid']);

		remove_avatars($user['uid']);

		// Now a tad of javascript to submit the parent window form
echo "<script type=\"text/javascript\">window.parent.submitUserForm();</script>";
exit;

		// Now a tad of javascript to submit the parent window form
echo "<script type=\"text/javascript\">window.parent.submitUserForm();</script>";
exit;

Zeile 199Zeile 201

$mybb->settings['avatardir'] = "../".$mybb->settings['avatardir'];



$mybb->settings['avatardir'] = "../".$mybb->settings['avatardir'];


 
	if(!is_dir($mybb->settings['avatardir']) && is_dir(MYBB_ROOT."/images/avatars/"))
{
$mybb->settings['avatardir'] = "../images/avatars/";
}


	// Within a gallery

	// Within a gallery

	if($gallery)

	if(!empty($gallery))

	{
$path = $gallery."/";
$real_path = $mybb->settings['avatardir']."/".$path;

	{
$path = $gallery."/";
$real_path = $mybb->settings['avatardir']."/".$path;

		if(is_dir($path))

		if(is_dir($real_path))

		{
// Build friendly gallery breadcrumb
$gallery_path = explode("/", $gallery);

		{
// Build friendly gallery breadcrumb
$gallery_path = explode("/", $gallery);

Zeile 370Zeile 377
	$db->update_query("users", $updated_user, "uid='{$user['uid']}'");

$plugins->run_hooks("admin_user_users_coppa_activate_commit");

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

$plugins->run_hooks("admin_user_users_coppa_activate_commit");


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

if($user['coppauser'])
{
flash_message($lang->success_coppa_activated, 'success');
}
else
{
flash_message($lang->success_activated, 'success');
}

if($admin_session['data']['last_users_url'])
{


















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

if($mybb->input['from'] == "home")
{
if($user['coppauser'])
{
$message = $lang->success_coppa_activated;
}
else
{
$message = $lang->success_activated;
}

update_admin_session('flash_message2', array('message' => $message, 'type' => 'success'));
}
else
{
if($user['coppauser'])
{
flash_message($lang->success_coppa_activated, 'success');
}
else
{
flash_message($lang->success_activated, 'success');
}
}

if($admin_session['data']['last_users_url'])
{

		$url = $admin_session['data']['last_users_url'];
update_admin_session('last_users_url', '');

		$url = $admin_session['data']['last_users_url'];
update_admin_session('last_users_url', '');

 
		
if($mybb->input['from'] == "home")
{
update_admin_session('from', 'home');
}

	}
else
{

	}
else
{

		$url = "index.php?module=user/users&amp;action=edit&amp;uid={$user['uid']}";

		$url = "index.php?module=user/users&action=edit&uid={$user['uid']}";

	}

	}

 
	

	admin_redirect($url);
}

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_user_users_add");

	admin_redirect($url);
}

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_user_users_add");

	
if($mybb->request_method == "post")
{
// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{
foreach($mybb->input['additionalgroups'] as $gid)
{
if($gid == $mybb->input['usergroup'])
{
unset($mybb->input['additionalgroups'][$gid]);
}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);
}
else

	
if($mybb->request_method == "post")
{
// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{
foreach($mybb->input['additionalgroups'] as $key => $gid)
{
if($gid == $mybb->input['usergroup'])
{
unset($mybb->input['additionalgroups'][$key]);
}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);
}
else

		{
$additionalgroups = '';
}

		{
$additionalgroups = '';
}





		// Set up user handler.
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler('insert');

		// Set up user handler.
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler('insert');

Zeile 439Zeile 468

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


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

		$errors = '';

		$errors = '';


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

		{

		{

			$errors = $userhandler->get_friendly_errors();
}
else
{
$user_info = $userhandler->insert_user();

			$errors = $userhandler->get_friendly_errors();
}
else
{
$user_info = $userhandler->insert_user();

			

			

			$plugins->run_hooks("admin_user_users_add_commit");

// Log admin action

			$plugins->run_hooks("admin_user_users_add_commit");

// Log admin action

Zeile 465Zeile 494
	while($profile_field = $db->fetch_array($query))
{
$profile_fields['required'][] = $profile_field;

	while($profile_field = $db->fetch_array($query))
{
$profile_fields['required'][] = $profile_field;

	}

	}


$page->add_breadcrumb_item($lang->create_user);
$page->output_header($lang->create_user);


$page->add_breadcrumb_item($lang->create_user);
$page->output_header($lang->create_user);

Zeile 478Zeile 507
	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

	}

	}

	else
{
$mybb->input = array(

	else
{
$mybb->input = array(

Zeile 491Zeile 520
	$form_container->output_row($lang->password." <em>*</em>", "", $form->generate_password_box('password', $mybb->input['password'], array('id' => 'password')), 'password');
$form_container->output_row($lang->confirm_password." <em>*</em>", "", $form->generate_password_box('confirm_password', $mybb->input['confirm_password'], array('id' => 'confirm_new_password')), 'confirm_new_password');
$form_container->output_row($lang->email_address." <em>*</em>", "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');

	$form_container->output_row($lang->password." <em>*</em>", "", $form->generate_password_box('password', $mybb->input['password'], array('id' => 'password')), 'password');
$form_container->output_row($lang->confirm_password." <em>*</em>", "", $form->generate_password_box('confirm_password', $mybb->input['confirm_password'], array('id' => 'confirm_new_password')), 'confirm_new_password');
$form_container->output_row($lang->email_address." <em>*</em>", "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');





	$display_group_options[0] = $lang->use_primary_user_group;
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))

	$display_group_options[0] = $lang->use_primary_user_group;
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))

Zeile 540Zeile 569
		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

			foreach($mybb->input['additionalgroups'] as $gid)

			foreach($mybb->input['additionalgroups'] as $key => $gid)

			{
if($gid == $mybb->input['usergroup'])
{

			{
if($gid == $mybb->input['usergroup'])
{

					unset($mybb->input['additionalgroups'][$gid]);

					unset($mybb->input['additionalgroups'][$key]);

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

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

Zeile 569Zeile 598
			"displaygroup" => $mybb->input['displaygroup'],
"postnum" => $mybb->input['postnum'],
"usertitle" => $mybb->input['usertitle'],

			"displaygroup" => $mybb->input['displaygroup'],
"postnum" => $mybb->input['postnum'],
"usertitle" => $mybb->input['usertitle'],

			"timezone" => $mybb->input['timezoneoffset'],

			"timezone" => $mybb->input['timezone'],

			"language" => $mybb->input['language'],
"profile_fields" => $mybb->input['profile_fields'],
"profile_fields_editable" => true,

			"language" => $mybb->input['language'],
"profile_fields" => $mybb->input['profile_fields'],
"profile_fields_editable" => true,

Zeile 597Zeile 626
			$updated_user['password'] = $mybb->input['new_password'];
$updated_user['password2'] = $mybb->input['confirm_new_password'];
}

			$updated_user['password'] = $mybb->input['new_password'];
$updated_user['password2'] = $mybb->input['confirm_new_password'];
}


$updated_user['birthday'] = array(
"day" => $mybb->input['birthday_day'],
"month" => $mybb->input['birthday_month'],
"year" => $mybb->input['birthday_year']
);

 

$updated_user['options'] = array(
"allownotices" => $mybb->input['allownotices'],


$updated_user['options'] = array(
"allownotices" => $mybb->input['allownotices'],

Zeile 652Zeile 675
					"avatardimensions" => "",
"avatartype" => ""
);

					"avatardimensions" => "",
"avatartype" => ""
);

				remove_avatars($mybb->user['uid']);

				remove_avatars($user['uid']);

			}



			}



Zeile 692Zeile 715
				}
else
{

				}
else
{

					$tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(uniqid(rand(), true));

					$tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(random_str());

					$fp = @fopen($tmp_name, "wb");
if(!$fp)
{

					$fp = @fopen($tmp_name, "wb");
if(!$fp)
{

Zeile 716Zeile 739
				{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{

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

						list($maxwidth, $maxheight) = explode("x", $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);

						if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);

Zeile 837Zeile 860

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


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

	if($user['avatar'])
{

	if($user['avatar'])
{

		if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";

		if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";

Zeile 902Zeile 925
	}
else
{

	}
else
{

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

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

	}

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

	}

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

Zeile 932Zeile 955
	{
$age = get_age($user['birthday']);
}

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

 


	else
{
$age = '';
}


	else
{
$age = '';
}


	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"{$user['avatar']}\" style=\"margin-top: {$avatar_top}px\" width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('rowspan' => 6, 'width' => 1));

	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"".htmlspecialchars_uni($user['avatar'])."\" style=\"margin-top: {$avatar_top}px\" width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('rowspan' => 6, 'width' => 1));

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

Zeile 977Zeile 1001
	{
$options[$usergroup['gid']] = $usergroup['title'];
$display_group_options[$usergroup['gid']] = $usergroup['title'];

	{
$options[$usergroup['gid']] = $usergroup['title'];
$display_group_options[$usergroup['gid']] = $usergroup['title'];

 
	}

if(!is_array($mybb->input['additionalgroups']))
{
$mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']);

	}

$form_container->output_row($lang->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');

	}

$form_container->output_row($lang->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');

Zeile 1017Zeile 1046
		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");

		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");








	
if($mybb->input['pmnotice'] > 1)
{
$mybb->input['pmnotice'] = 1;
}


	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

Zeile 1043Zeile 1077
	$date_options = array(
"<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->input['dateformat'], array('id' => 'dateformat')),
"<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->input['timeformat'], array('id' => 'timeformat')),

	$date_options = array(
"<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->input['dateformat'], array('id' => 'dateformat')),
"<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->input['timeformat'], array('id' => 'timeformat')),

		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->user['timezone']),

		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->input['timezone']),

		"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");

		"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");

Zeile 1059Zeile 1093
			{
if($tpp <= 0) continue;
$tpp_options[$tpp] = $tpp;

			{
if($tpp <= 0) continue;
$tpp_options[$tpp] = $tpp;

			}
}
}


			}
}
}


	$thread_age_options = array(
0 => $lang->use_default,
1 => $lang->show_threads_last_day,

	$thread_age_options = array(
0 => $lang->use_default,
1 => $lang->show_threads_last_day,

Zeile 1104Zeile 1138
		"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode'))
);
$form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");

		"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode'))
);
$form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");

 

$languages = array_merge(array('' => $lang->use_default), $lang->get_languages());


$other_options = array(
$form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->input['showredirect'])),
$form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->input['showcodebuttons'])),
"<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->input['style'], 0, "", 1),


$other_options = array(
$form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->input['showredirect'])),
$form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->input['showcodebuttons'])),
"<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->input['style'], 0, "", 1),

		"<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $lang->get_languages(), $mybb->input['language'], array('id' => 'language'))

		"<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $languages, $mybb->input['language'], array('id' => 'language'))

	);
$form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");


	);
$form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");


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


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


	//
// SIGNATURE EDITOR
//
$signature_editor = $form->generate_text_area("signature", $mybb->input['signature'], array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'width: 95%'));

	//
// SIGNATURE EDITOR
//
$signature_editor = $form->generate_text_area("signature", $mybb->input['signature'], array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'width: 95%'));

	$sig_smilies = "off";

	$sig_smilies = $lang->off;

	if($mybb->settings['sigsmilies'] == 1)
{

	if($mybb->settings['sigsmilies'] == 1)
{

		$sig_smilies = "on";

		$sig_smilies = $lang->on;

	}

	}

	$sig_mycode = "off";

	$sig_mycode = $lang->off;

	if($mybb->settings['sigmycode'] == 1)
{

	if($mybb->settings['sigmycode'] == 1)
{

		$sig_mycode = "on";

		$sig_mycode = $lang->on;

		$signature_editor .= build_mycode_inserter("signature");
}

		$signature_editor .= build_mycode_inserter("signature");
}

	$sig_html = "off";

	$sig_html = $lang->off;

	if($mybb->settings['sightml'] == 1)
{

	if($mybb->settings['sightml'] == 1)
{

		$sig_html = "on";

		$sig_html = $lang->on;

	}

	}

	$sig_imcode = "on";

	$sig_imgcode = $lang->off;

	if($mybb->settings['sigimgcode'] == 1)
{

	if($mybb->settings['sigimgcode'] == 1)
{

		$sig_imgcode = "off";

		$sig_imgcode = $lang->on;

	}
echo "<div id=\"tab_signature\">\n";
$form_container = new FormContainer("{$lang->signature}: {$user['username']}");

	}
echo "<div id=\"tab_signature\">\n";
$form_container = new FormContainer("{$lang->signature}: {$user['username']}");

Zeile 1163Zeile 1199
	$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"{$user['avatar']}\" width=\"{$scaled_dimensions['width']}\" style=\"margin-top: {$avatar_top}px\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('width' => 1));

	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"".htmlspecialchars_uni($user['avatar'])."\" width=\"{$scaled_dimensions['width']}\" style=\"margin-top: {$avatar_top}px\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('width' => 1));


if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{


if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{

Zeile 1186Zeile 1222

if($mybb->settings['maxavatardims'] != "")
{


if($mybb->settings['maxavatardims'] != "")
{

		list($max_width, $max_height) = explode("x", $mybb->settings['maxavatardims']);

		list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

		$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
}


		$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
}


Zeile 1199Zeile 1235
	if($user['avatar'])
{
$remove_avatar = "<br /><br />".$form->generate_check_box("remove_avatar", 1, "<strong>{$lang->remove_avatar}</strong>");

	if($user['avatar'])
{
$remove_avatar = "<br /><br />".$form->generate_check_box("remove_avatar", 1, "<strong>{$lang->remove_avatar}</strong>");

	}

	}


$table->construct_cell($lang->avatar_desc."{$remove_avatar}<br /><small>{$max_size}</small>");
$table->construct_row();


$table->construct_cell($lang->avatar_desc."{$remove_avatar}<br /><small>{$max_size}</small>");
$table->construct_row();

Zeile 1225Zeile 1261
	echo "<div class=\"title\">.. {$lang->or_select_avatar_gallery}</div>";
echo "<iframe src=\"index.php?module=user/users&amp;action=avatar_gallery&amp;uid={$user['uid']}\" width=\"100%\" height=\"350\" frameborder=\"0\"></iframe>";
echo "</div>";

	echo "<div class=\"title\">.. {$lang->or_select_avatar_gallery}</div>";
echo "<iframe src=\"index.php?module=user/users&amp;action=avatar_gallery&amp;uid={$user['uid']}\" width=\"100%\" height=\"350\" frameborder=\"0\"></iframe>";
echo "</div>";

	echo "</div>";

	echo "</div>";


$buttons[] = $form->generate_submit_button($lang->save_user);
$form->output_submit_wrapper($buttons);


$buttons[] = $form->generate_submit_button($lang->save_user);
$form->output_submit_wrapper($buttons);

Zeile 1265Zeile 1301
	{
// Delete the user
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

	{
// Delete the user
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

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

 
		$db->delete_query("userfields", "ufid='{$user['uid']}'");
$db->delete_query("privatemessages", "uid='{$user['uid']}'");
$db->delete_query("events", "uid='{$user['uid']}'");

		$db->delete_query("userfields", "ufid='{$user['uid']}'");
$db->delete_query("privatemessages", "uid='{$user['uid']}'");
$db->delete_query("events", "uid='{$user['uid']}'");

Zeile 1275Zeile 1310
		$db->delete_query("sessions", "uid='{$user['uid']}'");
$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");

		$db->delete_query("sessions", "uid='{$user['uid']}'");
$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");

 
		$db->delete_query("users", "uid='{$user['uid']}'");
$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");
$db->delete_query("reputation", "uid='{$user['uid']}' OR adduid='{$user['uid']}'");


// Update forum stats
update_stats(array('numusers' => '-1'));


// Update forum stats
update_stats(array('numusers' => '-1'));

Zeile 1311Zeile 1350
	
// Fetch default admin view
$default_view = fetch_default_view("user");

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


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


Zeile 1352Zeile 1395
	
$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"));

	

	

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

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

Zeile 1361Zeile 1404
	else
{
$popup = new PopupMenu("user_last", $lang->options);

	else
{
$popup = new PopupMenu("user_last", $lang->options);

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$user['lastip']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$user['lastip']}");


		$popup->add_item($lang->show_users_regged_with_ip, 
"index.php?module=user/users&amp;action=search&amp;results=1&amp;conditions=".urlencode(serialize(array("regip" => $user['lastip']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $user['lastip']))));

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['lastip']}");
$controls = $popup->fetch();
}

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['lastip']}");
$controls = $popup->fetch();
}

Zeile 1378Zeile 1422
	else
{
$popup = new PopupMenu("user_reg", $lang->options);

	else
{
$popup = new PopupMenu("user_reg", $lang->options);

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$user['regip']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$user['regip']}");

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("regip" => $user['regip']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $user['regip']))));

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();
}

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();
}

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


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


	$query = $db->simple_select("posts", "DISTINCT ipaddress, pid", "uid='{$mybb->input['uid']}'");



	$counter = 0;

$query = $db->simple_select("posts", "DISTINCT ipaddress", "uid='{$mybb->input['uid']}'");

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

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

		if(!$done_ip[$ip['ipaddress']])
{
$popup = new PopupMenu("post_{$ip['pid']}", $lang->options);
$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$ip['ipaddress']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$ip['ipaddress']}");
$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();

$table->construct_cell($ip['ipaddress']);
$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();
$done_ip[$ip['ipaddres']] = 1;
}

		++$counter;
$popup = new PopupMenu("id_{$counter}", $lang->options);
$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("regip" => $ip['ipaddress']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $ip['ipaddress']))));
$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();

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




	}

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

	}

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

Zeile 1428Zeile 1471
		if(!$destination_user['uid'])
{
$errors[] = $lang->error_invalid_user_destination;

		if(!$destination_user['uid'])
{
$errors[] = $lang->error_invalid_user_destination;

		}


		}


		if($source_user['uid'] == $destination_user['uid'])
{
$errors[] = $lang->error_cannot_merge_same_account;

		if($source_user['uid'] == $destination_user['uid'])
{
$errors[] = $lang->error_cannot_merge_same_account;

Zeile 1455Zeile 1498
			$db->update_query("events", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threadsubscriptions", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("forumsubscriptions", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("events", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threadsubscriptions", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("forumsubscriptions", $uid_update, "uid='{$source_user['uid']}'");

 
			$db->update_query("joinrequests", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("moderatorlog", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("pollvotes", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("moderatorlog", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("pollvotes", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("reputation", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reputation", array('adduid' => $destination_user['uid']), "adduid='{$source_user['uid']}'");

 
			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");

 
			$db->delete_query("sessions", "uid='{$source_user['uid']}'");

// Merging Reputation
$query = $db->simple_select("reputation", "rid, uid", "adduid = '{$source_user['uid']}' OR adduid = '{$uid_update['uid']}'", array("order_by" => "dateline", "order_dir" => "DESC"));
while($result = $db->fetch_array($query))
{
// Let's try and remove old one if it's the same uid
if($result['uid'] == $last['uid'])
{
$db->delete_query("reputation", "rid = '".$result['rid']."'");
$db->update_query("reputation", array("adduid" => $uid_update['uid']), "rid = '".$last['rid']."'");
}
$last = array(
"rid" => $result['rid'],
"uid" => $result['uid']
);
}

// Calculate new reputation
$query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'");
$total_reputation = $db->fetch_field($query, "total_rep");

// No reputation?
if(!$total_reputation)
{
$total_reputation = '0';
}





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


			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

Zeile 1473Zeile 1544
			$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'");
$edit_uid = array(
"edituid" => $destination_user['uid']

			$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'");
$edit_uid = array(
"edituid" => $destination_user['uid']

			);

			);

			$db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");

$from_uid = array(

			$db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");

$from_uid = array(

Zeile 1488Zeile 1559
			// Delete the old user
$db->delete_query("users", "uid='{$source_user['uid']}'");
$db->delete_query("banned", "uid='{$source_user['uid']}'");

			// Delete the old user
$db->delete_query("users", "uid='{$source_user['uid']}'");
$db->delete_query("banned", "uid='{$source_user['uid']}'");

 
			
// Get a list of forums where post count doesn't apply
$fids = array();
$query = $db->simple_select("forums", "fid", "usepostcounts=0");
while($fid = $db->fetch_field($query, "fid"))
{
$fids[] = $fid;
}

$fids_not_in = '';
if(!empty($fids))
{
$fids_not_in = "AND fid NOT IN(".implode(',', $fids).")";
}

			
// Update user post count

			
// Update user post count

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."'");

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");

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

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

 
			
// Use the earliest registration date
if($destination_user['regdate'] > $source_user['regdate'])
{
$db->update_query("users", array('regdate' => $source_user['regdate']), "uid='{$destination_user['uid']}'");
}


update_stats(array('numusers' => '-1'));



update_stats(array('numusers' => '-1'));


Zeile 1575Zeile 1666
			if(!$admin_view['vid'])
{
$default_view = fetch_default_view("user");

			if(!$admin_view['vid'])
{
$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);
}

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

Zeile 1611Zeile 1706
		if($mybb->input['displayas'])
{
$admin_view['view_type'] = $mybb->input['displayas'];

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

		}

		}


$results = build_users_view($admin_view);



$results = build_users_view($admin_view);


Zeile 1625Zeile 1720
		}
else
{

		}
else
{

			$errors[] = $lang->error_no_users_found;










			if($mybb->input['from'] == "home")
{
flash_message($lang->error_no_users_found, 'error');
admin_redirect("index.php");
exit;
}
else
{
$errors[] = $lang->error_no_users_found;
}

		}
}


		}
}


Zeile 1648Zeile 1752
	$form = new Form("index.php?module=user/users&amp;action=search", "post");

user_search_conditions($mybb->input, $form);

	$form = new Form("index.php?module=user/users&amp;action=search", "post");

user_search_conditions($mybb->input, $form);





	$form_container = new FormContainer($lang->display_options);
$sort_directions = array(
"asc" => $lang->ascending,

	$form_container = new FormContainer($lang->display_options);
$sort_directions = array(
"asc" => $lang->ascending,

Zeile 1675Zeile 1779
	
$page->output_nav_tabs($sub_tabs, 'browse_users');


	
$page->output_nav_tabs($sub_tabs, 'browse_users');


	if($mybb->input['search_id'] && $admin_session['user_views'][$mybb->input['search_id']])

	if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])

	{
$admin_view = $admin_session['data']['user_views'][$mybb->input['search_id']];
unset($admin_view['extra_sql']);

	{
$admin_view = $admin_session['data']['user_views'][$mybb->input['search_id']];
unset($admin_view['extra_sql']);

Zeile 1686Zeile 1790
		if($mybb->input['vid'])
{
$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");

		if($mybb->input['vid'])
{
$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");

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

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

			// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))

			// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))

			{

			{

				unset($admin_view);

				unset($admin_view);

			}

			}

		}

// Don't have a view? Fetch the default
if(!$admin_view)
{
$default_view = fetch_default_view("user");

		}

// Don't have a view? Fetch the default
if(!$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);
}

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

Zeile 1705Zeile 1813

// Fetch a list of all of the views for this user
$popup = new PopupMenu("views", $lang->views);


// Fetch a list of all of the views for this user
$popup = new PopupMenu("views", $lang->views);





	$query = $db->simple_select("adminviews", "*", "type='user' AND (visibility=2 OR uid={$mybb->user['uid']})", array("order_by" => "title"));
while($view = $db->fetch_array($query))

	$query = $db->simple_select("adminviews", "*", "type='user' AND (visibility=2 OR uid={$mybb->user['uid']})", array("order_by" => "title"));
while($view = $db->fetch_array($query))

	{

	{

		$popup->add_item(htmlspecialchars_uni($view['title']), "index.php?module=user/users&amp;vid={$view['vid']}");

		$popup->add_item(htmlspecialchars_uni($view['title']), "index.php?module=user/users&amp;vid={$view['vid']}");

	}

	}

	$popup->add_item("<em>{$lang->manage_views}</em>", "index.php?module=user/users&amp;action=views");
$admin_view['popup'] = $popup->fetch();


	$popup->add_item("<em>{$lang->manage_views}</em>", "index.php?module=user/users&amp;action=views");
$admin_view['popup'] = $popup->fetch();


Zeile 1723Zeile 1831

if(!$results)
{


if(!$results)
{

 
		// If we came from the home page and clicked on the "Activate Users" link, send them back to here
if($admin_session['data']['from'] == "home")
{
flash_message($admin_session['data']['flash_message2']['message'], $admin_session['data']['flash_message2']['type']);
update_admin_session('flash_message2', '');
update_admin_session('from', '');
admin_redirect("index.php");
exit;
}
else
{

			$errors[] = $lang->error_no_users_found;

			$errors[] = $lang->error_no_users_found;

 
		}

	}

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

	}

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

 
		echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n";

		$page->output_inline_error($errors);
}


		$page->output_inline_error($errors);
}


Zeile 1780Zeile 1901
		global $admin_session;
if(!$_REQUEST['search_id'])
{

		global $admin_session;
if(!$_REQUEST['search_id'])
{

			$search_id = md5(uniqid(rand(), true));

			$search_id = md5(random_str());

			$admin_session['data']['user_views'][$search_id] = $view;
update_admin_session('user_views', $admin_session['data']['user_views']);
$_REQUEST['search_id'] = $search_id;

			$admin_session['data']['user_views'][$search_id] = $view;
update_admin_session('user_views', $admin_session['data']['user_views']);
$_REQUEST['search_id'] = $search_id;

Zeile 1796Zeile 1917
	if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&amp;", "&", $view['url']))
{
update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));

	if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&amp;", "&", $view['url']))
{
update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));

 
	}

// Do we not have any views?
if(empty($view))
{
return false;

	}

$table = new Table;

	}

$table = new Table;

Zeile 1841Zeile 1968
	// EXACT matching fields
$user_exact_fields = array("referrer");
foreach($user_exact_fields as $search_field)

	// EXACT matching fields
$user_exact_fields = array("referrer");
foreach($user_exact_fields as $search_field)

	{

	{

		if($view['conditions'][$search_field])
{
$search_sql .= " AND u.{$search_field}='".$db->escape_string($view['conditions'][$search_field])."'";

		if($view['conditions'][$search_field])
{
$search_sql .= " AND u.{$search_field}='".$db->escape_string($view['conditions'][$search_field])."'";

Zeile 1853Zeile 1980
	foreach($direction_fields as $search_field)
{
$direction_field = $search_field."_dir";

	foreach($direction_fields as $search_field)
{
$direction_field = $search_field."_dir";

		if($view['conditions'][$search_field] && $view['conditions'][$direction_field])

		if(($view['conditions'][$search_field] || $view['conditions'][$search_field] === '0') && $view['conditions'][$direction_field])

		{
switch($view['conditions'][$direction_field])
{

		{
switch($view['conditions'][$direction_field])
{

Zeile 1876Zeile 2003
	{
if($view['conditions'][$search_field])
{

	{
if($view['conditions'][$search_field])
{

			$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);


 
			// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)

			// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)

			{


			{
$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);

				$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";
}
else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
if(!is_array($ip_range))

				$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";
}
else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
if(!is_array($ip_range))

				{

				{

					$ip_sql = "long{$search_field}='{$ip_range}'";

					$ip_sql = "long{$search_field}='{$ip_range}'";

				}

				}

				else
{
$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
}

				else
{
$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
}

			}

			}

			$search_sql .= " AND {$ip_sql}";
}

			$search_sql .= " AND {$ip_sql}";
}

 
	}

// Post IP searching
if($view['conditions']['postip'])
{
// IPv6 IP
if(strpos($view['conditions']['postip'], ":") !== false)
{
$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);
$ip_sql = "ipaddress LIKE '".$db->escape_string($view['conditions']['postip'])."'";
}
else
{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);
if(!is_array($ip_range))
{
$ip_sql = "longipaddress='{$ip_range}'";
}
else
{
$ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}
}
$ip_uids = array(0);
$query = $db->simple_select("posts", "uid", $ip_sql);
while($uid = $db->fetch_field($query, "uid"))
{
$ip_uids[] = $uid;
}
$search_sql .= " AND u.uid IN(".implode(',', $ip_uids).")";
unset($ip_uids);

	}

// Usergroup based searching

	}

// Usergroup based searching

Zeile 1915Zeile 2072
				case "sqlite3":
case "sqlite2":
$additional_sql .= " OR ','||additionalgroups||',' LIKE '%,{$usergroup},%'";

				case "sqlite3":
case "sqlite2":
$additional_sql .= " OR ','||additionalgroups||',' LIKE '%,{$usergroup},%'";

 
					break;

				default:
$additional_sql .= "OR CONCAT(',',additionalgroups,',') LIKE '%,{$usergroup},%'";
}
}
$search_sql .= " AND (u.usergroup IN (".implode(",", $view['conditions']['usergroup']).") {$additional_sql})";

				default:
$additional_sql .= "OR CONCAT(',',additionalgroups,',') LIKE '%,{$usergroup},%'";
}
}
$search_sql .= " AND (u.usergroup IN (".implode(",", $view['conditions']['usergroup']).") {$additional_sql})";

	}


	}


	// COPPA users only?
if($view['conditions']['coppa'])
{

	// COPPA users only?
if($view['conditions']['coppa'])
{

Zeile 1932Zeile 2090
	if($view['extra_sql'])
{
$search_sql .= $view['extra_sql'];

	if($view['extra_sql'])
{
$search_sql .= $view['extra_sql'];

	}

	}


// Lets fetch out how many results we have
$query = $db->query("


// Lets fetch out how many results we have
$query = $db->query("

Zeile 1941Zeile 2099
		WHERE {$search_sql}
");
$num_results = $db->fetch_field($query, "num_results");

		WHERE {$search_sql}
");
$num_results = $db->fetch_field($query, "num_results");



	

	// No matching results then return false
if(!$num_results)
{

	// No matching results then return false
if(!$num_results)
{

Zeile 1966Zeile 2124
		{
$start = 0;
$mybb->input['page'] = 1;

		{
$start = 0;
$mybb->input['page'] = 1;

 
		}

$from_bit = "";
if($mybb->input['from'] == "home")
{
$from_bit = "&amp;from=home";

		}

switch($view['sortby'])
{

		}

switch($view['sortby'])
{

			case "numposts":
$view['sortby'] = "postnum";
break;

 
			case "regdate":
case "lastactive":
case "postnum":
case "reputation":

			case "regdate":
case "lastactive":
case "postnum":
case "reputation":

 
				$view['sortby'] = $db->escape_string($view['sortby']);
break;
case "numposts":
$view['sortby'] = "postnum";
break;

			case "warninglevel":

			case "warninglevel":

 
				$view['sortby'] = "warningpoints";

				break;
default:
$view['sortby'] = "username";

				break;
default:
$view['sortby'] = "username";

Zeile 2024Zeile 2191
			{
if($user['coppauser'])
{

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

					$popup->add_item($lang->approve_coppa_user, "index.php?module=user/users&amp;action=activate_user&amp;uid={$user['uid']}");

					$popup->add_item($lang->approve_coppa_user, "index.php?module=user/users&amp;action=activate_user&amp;uid={$user['uid']}{$from_bit}");

				}
else
{

				}
else
{

					$popup->add_item($lang->approve_user, "index.php?module=user/users&amp;action=activate_user&amp;uid={$user['uid']}");

					$popup->add_item($lang->approve_user, "index.php?module=user/users&amp;action=activate_user&amp;uid={$user['uid']}{$from_bit}");

				}
}


				}
}


Zeile 2074Zeile 2241
			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

			$user['view']['avatar'] = "<img src=\"{$user['avatar']}\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";

			$user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";


if($view['view_type'] == "card")
{


if($view['view_type'] == "card")
{

Zeile 2408Zeile 2575
				foreach($select_options as $val)
{
$val = trim($val);

				foreach($select_options as $val)
{
$val = trim($val);

					$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $values[$field_name] ? true : false)))."<br />";

					$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $selected_options[$val] ? true : false)))."<br />";

				}
break;
case "textarea":

				}
break;
case "textarea":