Vergleich admin/modules/user/users.php - 1.6.10 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 166Zeile 166
		}

$mybb->input['avatar'] = str_replace(array("./", ".."), "", $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 177Zeile 177
			);

$db->update_query("users", $updated_avatar, "uid='".$user['uid']."'");

			);

$db->update_query("users", $updated_avatar, "uid='".$user['uid']."'");

			
$plugins->run_hooks("admin_user_users_avatar_gallery_commit");


$plugins->run_hooks("admin_user_users_avatar_gallery_commit");


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


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

Zeile 206Zeile 206
	{
$gallery = str_replace(array("..", "\x0"), "", $mybb->input['gallery']);
}

	{
$gallery = str_replace(array("..", "\x0"), "", $mybb->input['gallery']);
}

	



	$breadcrumb = "<a href=\"index.php?module=user-users&amp;action=avatar_gallery&amp;uid={$user['uid']}\">Default Gallery</a>";

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

	$breadcrumb = "<a href=\"index.php?module=user-users&amp;action=avatar_gallery&amp;uid={$user['uid']}\">Default Gallery</a>";

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

Zeile 215Zeile 215
	{
$mybb->settings['avatardir'] = "../images/avatars/";
}

	{
$mybb->settings['avatardir'] = "../images/avatars/";
}

	



	// Within a gallery
if(!empty($gallery))
{

	// Within a gallery
if(!empty($gallery))
{

Zeile 256Zeile 256
	// Get a listing of avatars/directories within this gallery
$sub_galleries = $avatars = array();
$files = @scandir($real_path);

	// Get a listing of avatars/directories within this gallery
$sub_galleries = $avatars = array();
$files = @scandir($real_path);

	



	if(is_array($files))
{
foreach($files as $file)

	if(is_array($files))
{
foreach($files as $file)

Zeile 265Zeile 265
			{
continue;
}

			{
continue;
}

			



			// Build friendly name
$friendly_name = str_replace(array("_", "%20"), " ", $file);
$friendly_name = ucwords($friendly_name);

			// Build friendly name
$friendly_name = str_replace(array("_", "%20"), " ", $file);
$friendly_name = ucwords($friendly_name);

Zeile 294Zeile 294
			else if(preg_match("#\.(jpg|jpeg|gif|bmp|png)$#i", $file))
{
$friendly_name = preg_replace("#\.(jpg|jpeg|gif|bmp|png)$#i", "", $friendly_name);

			else if(preg_match("#\.(jpg|jpeg|gif|bmp|png)$#i", $file))
{
$friendly_name = preg_replace("#\.(jpg|jpeg|gif|bmp|png)$#i", "", $friendly_name);

	



				// Fetch dimensions
$dimensions = @getimagesize($real_path."/".$file);

				// Fetch dimensions
$dimensions = @getimagesize($real_path."/".$file);

	



				$avatars[] = array(
"path" => $path.$file,
"friendly_name" => $friendly_name,

				$avatars[] = array(
"path" => $path.$file,
"friendly_name" => $friendly_name,

Zeile 317Zeile 317
	if(is_array($sub_galleries))
{
foreach($sub_galleries as $gallery)

	if(is_array($sub_galleries))
{
foreach($sub_galleries as $gallery)

		{

		{

			if(!$gallery['thumb'])
{
$gallery['thumb'] = "styles/{$page->style}/images/avatar_gallery.gif";
$gallery['thumb_width'] = 64;
$gallery['thumb_height'] = 64;

			if(!$gallery['thumb'])
{
$gallery['thumb'] = "styles/{$page->style}/images/avatar_gallery.gif";
$gallery['thumb_width'] = 64;
$gallery['thumb_height'] = 64;

			}

			}

			else
{
$gallery['thumb'] = "{$mybb->settings['avatardir']}/{$gallery['thumb']}";
}
$scaled_dimensions = scale_image($gallery['thumb_width'], $gallery['thumb_height'], 80, 80);

			else
{
$gallery['thumb'] = "{$mybb->settings['avatardir']}/{$gallery['thumb']}";
}
$scaled_dimensions = scale_image($gallery['thumb_width'], $gallery['thumb_height'], 80, 80);

			$top = ceil((80-$scaled_dimensions['height'])/2);

			$top = ceil((80-$scaled_dimensions['height'])/2);

			$left = ceil((80-$scaled_dimensions['width'])/2);
echo "<li><a href=\"index.php?module=user-users&amp;action=avatar_gallery&amp;uid={$user['uid']}&amp;gallery={$gallery['path']}\"><span class=\"image\"><img src=\"{$gallery['thumb']}\" alt=\"\" style=\"margin-top: {$top}px;\" height=\"{$scaled_dimensions['height']}\" width=\"{$scaled_dimensions['width']}\"></span><span class=\"title\">{$gallery['friendly_name']}</span></a></li>\n";
}

			$left = ceil((80-$scaled_dimensions['width'])/2);
echo "<li><a href=\"index.php?module=user-users&amp;action=avatar_gallery&amp;uid={$user['uid']}&amp;gallery={$gallery['path']}\"><span class=\"image\"><img src=\"{$gallery['thumb']}\" alt=\"\" style=\"margin-top: {$top}px;\" height=\"{$scaled_dimensions['height']}\" width=\"{$scaled_dimensions['width']}\"></span><span class=\"title\">{$gallery['friendly_name']}</span></a></li>\n";
}

Zeile 353Zeile 353
	echo "</html>";
exit;
}

	echo "</html>";
exit;
}





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

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

Zeile 365Zeile 365
	}

$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");

	}

$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");

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

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


// Does the user not exist?
if(!$user['uid'] || $user['usergroup'] != 5)


// Does the user not exist?
if(!$user['uid'] || $user['usergroup'] != 5)

Zeile 395Zeile 395
	}

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

	}

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

	



	$plugins->run_hooks("admin_user_users_coppa_activate_commit");

// Log admin action

	$plugins->run_hooks("admin_user_users_coppa_activate_commit");

// Log admin action

Zeile 411Zeile 411
		{
$message = $lang->success_activated;
}

		{
$message = $lang->success_activated;
}

		



		update_admin_session('flash_message2', array('message' => $message, 'type' => 'success'));

		update_admin_session('flash_message2', array('message' => $message, 'type' => 'success'));

	}
else
{

	}
else
{

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

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

		}

		}

		else
{
flash_message($lang->success_activated, 'success');
}
}

		else
{
flash_message($lang->success_activated, 'success');
}
}

	



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

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

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

	}

	}

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

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

	



	admin_redirect($url);
}

	admin_redirect($url);
}





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

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

	



	if($mybb->request_method == "post")
{
// Determine the usergroup stuff

	if($mybb->request_method == "post")
{
// Determine the usergroup stuff

Zeile 498Zeile 498
		else
{
$user_info = $userhandler->insert_user();

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

			



			$plugins->run_hooks("admin_user_users_add_commit");

			$plugins->run_hooks("admin_user_users_add_commit");

			



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


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


Zeile 518Zeile 518

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

		



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

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

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

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

Zeile 546Zeile 546
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

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

		$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

$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 556Zeile 556

// Output custom profile fields - required
output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);


// Output custom profile fields - required
output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);





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

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

Zeile 568Zeile 568
if($mybb->input['action'] == "edit")
{
$plugins->run_hooks("admin_user_users_edit");

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

	



	$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);


	$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);


Zeile 704Zeile 704
				);
remove_avatars($user['uid']);
}

				);
remove_avatars($user['uid']);
}

			



			// Are we uploading a new avatar?
if($_FILES['avatar_upload']['name'])
{

			// Are we uploading a new avatar?
if($_FILES['avatar_upload']['name'])
{

Zeile 724Zeile 724
						"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);

						"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);

				}

				}

			}
// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{
$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);

			}
// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{
$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);

				$mybb->input['avatar_url'] = htmlspecialchars_uni($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)

				$ext = get_extension($mybb->input['avatar_url']);

// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)

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

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

					{

					{

						$avatar_error = $lang->error_invalidavatarurl;
}
else

						$avatar_error = $lang->error_invalidavatarurl;
}
else

Zeile 757Zeile 756
						if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

						if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

						}
}
}

						}
}
}


if(empty($avatar_error))
{


if(empty($avatar_error))
{

Zeile 773Zeile 772
						}
}
}

						}
}
}

				



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

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

Zeile 846Zeile 845
					if(!is_array($errors))
{
$suspend_length = fetch_time_length(intval($mybb->input[$option['time']]), $mybb->input[$option['period']]);

					if(!is_array($errors))
{
$suspend_length = fetch_time_length(intval($mybb->input[$option['time']]), $mybb->input[$option['period']]);

	



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

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

Zeile 864Zeile 863
						elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

						elseif(!$user[$option['update_field']])
{
// New suspension for this user... bad user!

							$extra_user_updates[$option['update_field']] = 1;				

							$extra_user_updates[$option['update_field']] = 1;

							if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

							if($suspend_length == "-1")
{
$extra_user_updates[$option['update_length']] = 0;

Zeile 887Zeile 886
			{
$user_info = $userhandler->update_user();
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");

			{
$user_info = $userhandler->update_user();
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");

				



				// if we're updating the user's signature preferences, do so now
if($mybb->input['update_posts'] == 'enable' || $mybb->input['update_posts'] == 'disable')
{

				// if we're updating the user's signature preferences, do so now
if($mybb->input['update_posts'] == 'enable' || $mybb->input['update_posts'] == 'disable')
{

Zeile 896Zeile 895
					);
$db->update_query("posts", $update_signature, "uid='{$user['uid']}'");
}

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

				



				$plugins->run_hooks("admin_user_users_edit_commit");

// Log admin action

				$plugins->run_hooks("admin_user_users_edit_commit");

// Log admin action

Zeile 965Zeile 964

$page->add_breadcrumb_item($lang->edit_user.": ".htmlspecialchars_uni($user['username']));
$page->output_header($lang->edit_user);


$page->add_breadcrumb_item($lang->edit_user.": ".htmlspecialchars_uni($user['username']));
$page->output_header($lang->edit_user);

		



	$sub_tabs['edit_user'] = array(
'title' => $lang->edit_user,
'description' => $lang->edit_user_desc

	$sub_tabs['edit_user'] = array(
'title' => $lang->edit_user,
'description' => $lang->edit_user_desc

Zeile 981Zeile 980
	{
$page->output_inline_error($errors);
}

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

	



	// Is this user a COPPA user? We show a warning & activate link
if($user['coppauser'])
{

	// Is this user a COPPA user? We show a warning & activate link
if($user['coppauser'])
{

Zeile 1070Zeile 1069
	if($posts == 0)
{
$percent_posts = "0";

	if($posts == 0)
{
$percent_posts = "0";

	}
else

	}
else

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

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

Zeile 1084Zeile 1083
		$reputation = get_reputation($user['reputation']);
}
else

		$reputation = get_reputation($user['reputation']);
}
else

	{

	{

		$reputation = "-";
}


		$reputation = "-";
}


Zeile 1096Zeile 1095
			$warning_level = 100;
}
$warning_level = get_colored_warning_level($warning_level);

			$warning_level = 100;
}
$warning_level = get_colored_warning_level($warning_level);

	}


	}


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

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





	$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->registration_date}:</strong> {$reg_date}");
$table->construct_cell("<strong>{$lang->local_time}:</strong> {$local_time}");

	$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->registration_date}:</strong> {$reg_date}");
$table->construct_cell("<strong>{$lang->local_time}:</strong> {$local_time}");

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<strong>{$lang->posts}:</strong> {$user['postnum']}");
$table->construct_cell("<strong>{$lang->age}:</strong> {$age}");
$table->construct_row();
$table->construct_cell("<strong>{$lang->posts_per_day}:</strong> {$posts_per_day}");
$table->construct_cell("<strong>{$lang->reputation}:</strong> {$reputation}");

	$table->construct_cell("<strong>{$lang->posts}:</strong> {$user['postnum']}");
$table->construct_cell("<strong>{$lang->age}:</strong> {$age}");
$table->construct_row();
$table->construct_cell("<strong>{$lang->posts_per_day}:</strong> {$posts_per_day}");
$table->construct_cell("<strong>{$lang->reputation}:</strong> {$reputation}");

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<strong>{$lang->percent_of_total_posts}:</strong> {$percent_posts}");
$table->construct_cell("<strong>{$lang->warning_level}:</strong> {$warning_level}");

	$table->construct_cell("<strong>{$lang->percent_of_total_posts}:</strong> {$percent_posts}");
$table->construct_cell("<strong>{$lang->warning_level}:</strong> {$warning_level}");

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<strong>{$lang->registration_ip}:</strong> {$user['regip']}");
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> {$user['lastip']}");
$table->construct_row();

	$table->construct_cell("<strong>{$lang->registration_ip}:</strong> {$user['regip']}");
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> {$user['lastip']}");
$table->construct_row();

	



	$table->output("{$lang->user_overview}: {$user['username']}");
echo "</div>\n";


	$table->output("{$lang->user_overview}: {$user['username']}");
echo "</div>\n";


Zeile 1143Zeile 1142
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

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

		$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

	}

	



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

	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->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups');
$form_container->output_row($lang->display_user_group." <em>*</em>", "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');

	$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->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups');
$form_container->output_row($lang->display_user_group." <em>*</em>", "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');

Zeile 1165Zeile 1164
	output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);

$form_container->end();

	output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);

$form_container->end();

	



	$form_container = new FormContainer($lang->optional_profile_info.": {$user['username']}");
$form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');
$form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website');

	$form_container = new FormContainer($lang->optional_profile_info.": {$user['username']}");
$form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');
$form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website');

Zeile 1226Zeile 1225
	{
$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 1427Zeile 1426
	<script type="text/javascript">
<!--
if(sig_checked == 0)

	<script type="text/javascript">
<!--
if(sig_checked == 0)

		{

		{

			$("suspend_action").hide();
}
// -->

			$("suspend_action").hide();
}
// -->

Zeile 1472Zeile 1471

if($errors)
{


if($errors)
{

		$avatar_url = $mybb->input['avatar_url'];

		$avatar_url = htmlspecialchars_uni($mybb->input['avatar_url']);

	}

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

	}

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

Zeile 1494Zeile 1493

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

	



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

// Custom avatar

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

// Custom avatar

Zeile 1517Zeile 1516
	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 "<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>";

	



	//
// MODERATOR OPTIONS
//

	//
// MODERATOR OPTIONS
//

Zeile 1596Zeile 1595
function toggleBox(action)
{
if(action == "modpost")

function toggleBox(action)
{
if(action == "modpost")

	{

	{

		$("suspendposting").checked = false;
$("suspost").hide();

		$("suspendposting").checked = false;
$("suspost").hide();

		



		if($("moderateposting").checked == true)
{
$("modpost").show();

		if($("moderateposting").checked == true)
{
$("modpost").show();

Zeile 1607Zeile 1606
		else if($("moderateposting").checked == false)
{
$("modpost").hide();

		else if($("moderateposting").checked == false)
{
$("modpost").hide();

		}		

		}

	}
else if(action == "suspost")
{

	}
else if(action == "suspost")
{

Zeile 1632Zeile 1631
else
{
$("modpost").show();

else
{
$("modpost").show();

}

}


if($("suspendposting").checked == false)
{


if($("suspendposting").checked == false)
{

Zeile 1645Zeile 1644

// -->
</script>';


// -->
</script>';





	$page->output_footer();
}

	$page->output_footer();
}





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

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

	



	$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);


	$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);


Zeile 1662Zeile 1661
		flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=user-users");
}

		flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=user-users");
}

	



	if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))
{
flash_message($lang->error_no_perms_super_admin, 'error');

	if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))
{
flash_message($lang->error_no_perms_super_admin, 'error');

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

		$db->delete_query("threadsubscriptions", "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("users", "uid='{$user['uid']}'");
$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");

Zeile 1693Zeile 1691
		$db->delete_query("awaitingactivation", "uid='{$user['uid']}'");
$db->delete_query("posts", "uid = '{$user['uid']}' AND visible = '-2'");
$db->delete_query("threads", "uid = '{$user['uid']}' AND visible = '-2'");

		$db->delete_query("awaitingactivation", "uid='{$user['uid']}'");
$db->delete_query("posts", "uid = '{$user['uid']}' AND visible = '-2'");
$db->delete_query("threads", "uid = '{$user['uid']}' AND visible = '-2'");

 

// Update thread ratings
$query = $db->query("
SELECT r.*, t.numratings, t.totalratings
FROM ".TABLE_PREFIX."threadratings r
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=r.tid)
WHERE r.uid='{$user['uid']}'
");
while($rating = $db->fetch_array($query))
{
$update_thread = array(
"numratings" => $rating['numratings'] - 1,
"totalratings" => $rating['totalratings'] - $rating['rating']
);
$db->update_query("threads", $update_thread, "tid='{$rating['tid']}'");
}

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


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


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





		// Update forums & threads if user is the lastposter
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

		// Update forums & threads if user is the lastposter
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

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

		$db->update_query("forums", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");
$db->update_query("threads", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");


		$db->update_query("forums", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");
$db->update_query("threads", array("lastposteruid" => 0), "lastposteruid = '{$user['uid']}'");


Zeile 1714Zeile 1731
		{
$db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'");
$cache->update_moderators();

		{
$db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'");
$cache->update_moderators();

		}

$plugins->run_hooks("admin_user_users_delete_commit");


		}

$plugins->run_hooks("admin_user_users_delete_commit");


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

flash_message($lang->success_user_deleted, 'success');
admin_redirect("index.php?module=user-users");

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

flash_message($lang->success_user_deleted, 'success');
admin_redirect("index.php?module=user-users");

	}
else

	}
else

	{
$page->output_confirm_action("index.php?module=user-users&action=delete&uid={$user['uid']}", $lang->user_deletion_confirmation);
}

	{
$page->output_confirm_action("index.php?module=user-users&action=delete&uid={$user['uid']}", $lang->user_deletion_confirmation);
}

Zeile 1733Zeile 1750
if($mybb->input['action'] == "referrers")
{
$plugins->run_hooks("admin_user_users_referrers");

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

	



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

	$page->add_breadcrumb_item($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']}",
'description' => $lang->show_referrers_desc
);

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

	



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

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

	



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

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

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

	}


	}


	$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['conditions']['referrer'] = $mybb->input['uid'];


	$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['conditions']['referrer'] = $mybb->input['uid'];


Zeile 1775Zeile 1792
	else
{
echo $view;

	else
{
echo $view;

	}

$page->output_footer();
}


	}

$page->output_footer();
}


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

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

	



	$page->add_breadcrumb_item($lang->ip_addresses);

	$page->add_breadcrumb_item($lang->ip_addresses);

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


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


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

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

	



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

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

	



	$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'], $user['username']);

	$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'], $user['username']);

	



	$table = new Table;

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

	



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

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

Zeile 1814Zeile 1831
	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, 

		$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->info_on_ip, "{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$user['lastip']}", "MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$user['lastip']}', 'iplookup', 500, 250); return false;");

"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->info_on_ip, "{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$user['lastip']}", "MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$user['lastip']}', 'iplookup', 500, 250); return false;");

Zeile 1822Zeile 1839
		$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_cell($controls, array('class' => "align_center"));

	$table->construct_row();

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

	$table->construct_row();

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

	}

	}

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

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

Zeile 1842Zeile 1859
	$table->construct_cell("<strong>{$lang->registration_ip}:</strong> {$user['regip']}");
$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();

	$table->construct_cell("<strong>{$lang->registration_ip}:</strong> {$user['regip']}");
$table->construct_cell($controls, array('class' => "align_center"));
$table->construct_row();

	



	$counter = 0;

	$counter = 0;

	



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

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

Zeile 1855Zeile 1872
		$popup->add_item($lang->info_on_ip, "{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$ip['ipaddress']}", "MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$ip['ipaddress']}', 'iplookup', 500, 250); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();

		$popup->add_item($lang->info_on_ip, "{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$ip['ipaddress']}", "MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$ip['ipaddress']}', 'iplookup', 500, 250); return false;");
$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->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']}");

	



	$page->output_footer();
}

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

	$page->output_footer();
}

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

	



	if($mybb->request_method == "post")
{
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['source_username']))."'");

	if($mybb->request_method == "post")
{
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['source_username']))."'");

Zeile 1877Zeile 1894
		if(!$source_user['uid'])
{
$errors[] = $lang->error_invalid_user_source;

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

		}


		}


		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['destination_username']))."'");
$destination_user = $db->fetch_array($query);
if(!$destination_user['uid'])
{
$errors[] = $lang->error_invalid_user_destination;

		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['destination_username']))."'");
$destination_user = $db->fetch_array($query);
if(!$destination_user['uid'])
{
$errors[] = $lang->error_invalid_user_destination;

		}


		}


		// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
if(!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid'])))
{
flash_message($lang->error_no_perms_super_admin, 'error');
admin_redirect("index.php?module=user-users");

		// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
if(!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid'])))
{
flash_message($lang->error_no_perms_super_admin, 'error');
admin_redirect("index.php?module=user-users");

		}


		}


		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 1911Zeile 1928
			if(!$existing_admin_options)
{
$db->update_query("adminoptions", $uid_update, "uid='{$source_user['uid']}'");

			if(!$existing_admin_options)
{
$db->update_query("adminoptions", $uid_update, "uid='{$source_user['uid']}'");

			}


			}


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

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

Zeile 1926Zeile 1943
			$db->update_query("reportedposts", $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->update_query("reportedposts", $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->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'");
$db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");

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

// Is the source user a moderator?

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

// Is the source user a moderator?

Zeile 1936Zeile 1956
				// Update the moderator cache...
$cache->update_moderators();
}

				// Update the moderator cache...
$cache->update_moderators();
}


// Forums & Threads
$db->update_query("forums", array("lastposteruid" => $destination_user['uid']), "lastposteruid = '{$source_user['uid']}'");
$db->update_query("threads", array("lastposteruid" => $destination_user['uid']), "lastposteruid = '{$source_user['uid']}'");

 

// Banning
$db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");

// Merging Reputation
// First, let's change all the details over to our new user...


// Banning
$db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");

// Merging Reputation
// First, let's change all the details over to our new user...

			$rep_update = array(
"adduid" => $destination_user['uid'],
"uid" => $destination_user['uid']
);
$db->update_query("reputation", $rep_update, "adduid = '".$source_user['uid']."' OR uid = '".$source_user['uid']."'");

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





// Now that all the repuation is merged, figure out what to do with this user's comments...
$options = array(


// Now that all the repuation is merged, figure out what to do with this user's comments...
$options = array(

Zeile 1996Zeile 2009
			$total_reputation = $db->fetch_field($query, "total_rep");

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

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

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

 

// Calculate warning points
$query = $db->query("
SELECT SUM(points) as warn_lev
FROM ".TABLE_PREFIX."warnings
WHERE uid='{$source_user['uid']}' AND expired='0'
");
$original_warn_level = $db->fetch_field($query, "warn_lev");

$query = $db->query("
SELECT SUM(points) as warn_lev
FROM ".TABLE_PREFIX."warnings
WHERE uid='{$destination_user['uid']}' AND expired='0'
");
$new_warn_level = $db->fetch_field($query, "warn_lev");
$db->update_query("users", array("warningpoints" => intval($original_warn_level + $new_warn_level)), "uid='{$destination_user['uid']}'");


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


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

			);

			);

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

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

Zeile 2011Zeile 2040

$from_uid = array(
"fromid" => $destination_user['uid']


$from_uid = array(
"fromid" => $destination_user['uid']

			);	

			);

			$db->update_query("privatemessages", $from_uid, "fromid='{$source_user['uid']}'");
$to_uid = array(
"toid" => $destination_user['uid']

			$db->update_query("privatemessages", $from_uid, "fromid='{$source_user['uid']}'");
$to_uid = array(
"toid" => $destination_user['uid']

			);	

			);

			$db->update_query("privatemessages", $to_uid, "toid='{$source_user['uid']}'");

			$db->update_query("privatemessages", $to_uid, "toid='{$source_user['uid']}'");

 

// Buddy/ignore lists

$destination_buddies = explode(',', $destination_user['buddylist']);
$source_buddies = explode(',', $source_user['buddylist']);
$buddies = array_unique(array_merge($source_buddies, $destination_buddies));
// Make sure the new buddy list doesn't contain either users
$buddies_array = array_diff($buddies, array($destination_user['uid'], $source_user['uid']));

$destination_ignored = explode(',', $destination_user['ignorelist']);
$source_ignored = explode(',', $destination_user['ignorelist']);
$ignored = array_unique(array_merge($source_ignored, $destination_ignored));
// ... and the same for the new ignore list
$ignored_array = array_diff($ignored, array($destination_user['uid'], $source_user['uid']));

// Remove any ignored users from the buddy list
$buddies = array_diff($buddies_array, $ignored_array);
// implode the arrays so we get a nice neat list for each
$buddies = trim(implode(',', $buddies), ',');
$ignored = trim(implode(',', $ignored_array), ',');

$lists = array(
"buddylist" => $buddies,
"ignorelist" => $ignored
);
$db->update_query("users", $lists, "uid='{$destination_user['uid']}'");


// 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']}'");

			









// Did the old user have an uploaded avatar?
if($source_user['avatartype'] == "upload")
{
// Removes the ./ at the beginning the timestamp on the end...
@unlink("../".substr($source_user['avatar'], 2, -20));
}


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

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

Zeile 2029Zeile 2091
			{
$fids[] = $fid;
}

			{
$fids[] = $fid;
}

			



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

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

			



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

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

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

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

			// Use the earliest registration date
if($destination_user['regdate'] > $source_user['regdate'])
{

Zeile 2051Zeile 2113
			}

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

			}

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

			



			$plugins->run_hooks("admin_user_users_merge_commit");

// Log admin action

			$plugins->run_hooks("admin_user_users_merge_commit");

// Log admin action

Zeile 2066Zeile 2128

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


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

	



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

// If we have any error messages, show them

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

// If we have any error messages, show them

Zeile 2100Zeile 2162
}

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

}

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

{

{

	$plugins->run_hooks("admin_user_users_search");

	$plugins->run_hooks("admin_user_users_search");

	



	if($mybb->request_method == "post" || $mybb->input['results'] == 1)
{
// Build view options from incoming search options

	if($mybb->request_method == "post" || $mybb->input['results'] == 1)
{
// Build view options from incoming search options

Zeile 2114Zeile 2176
			if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);

			if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);

			}
}

			}
}


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


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

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

		}

		}


// Override specific parts of the view
unset($admin_view['vid']);


// Override specific parts of the view
unset($admin_view['vid']);

Zeile 2144Zeile 2206
		{
$admin_view['view_type'] = $mybb->input['type'];
}

		{
$admin_view['view_type'] = $mybb->input['type'];
}

		



		if($mybb->input['conditions'])
{
$admin_view['conditions'] = $mybb->input['conditions'];
}

		if($mybb->input['conditions'])
{
$admin_view['conditions'] = $mybb->input['conditions'];
}

		



		if($mybb->input['sortby'])

		if($mybb->input['sortby'])

		{

		{

			$admin_view['sortby'] = $mybb->input['sortby'];

			$admin_view['sortby'] = $mybb->input['sortby'];

		}


		}


		if(intval($mybb->input['perpage']))
{
$admin_view['perpage'] = $mybb->input['perpage'];
}

		if(intval($mybb->input['perpage']))
{
$admin_view['perpage'] = $mybb->input['perpage'];
}

		



		if($mybb->input['order'])
{
$admin_view['sortorder'] = $mybb->input['order'];
}

		if($mybb->input['order'])
{
$admin_view['sortorder'] = $mybb->input['order'];
}

		



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

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

		



		if($mybb->input['profile_fields'])
{
$admin_view['custom_profile_fields'] = $mybb->input['profile_fields'];

		if($mybb->input['profile_fields'])
{
$admin_view['custom_profile_fields'] = $mybb->input['profile_fields'];

Zeile 2178Zeile 2240
		$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 2198Zeile 2260
				$errors[] = $lang->error_no_users_found;
}
}

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

	}


	}


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

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

	



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

// If we have any error messages, show them

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

// If we have any error messages, show them

Zeile 2210Zeile 2272
	{
$page->output_inline_error($errors);
}

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

	



	if(!$mybb->input['displayas'])
{
$mybb->input['displayas'] = "card";

	if(!$mybb->input['displayas'])
{
$mybb->input['displayas'] = "card";

Zeile 2219Zeile 2281
	$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 2233Zeile 2295
	$buttons[] = $form->generate_submit_button($lang->find_users);
$form->output_submit_wrapper($buttons);
$form->end();

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





	$page->output_footer();
}

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

	$page->output_footer();
}

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





	if($mybb->input['vid'] || $mybb->cookies['acp_view'])
{
// We have a custom view

	if($mybb->input['vid'] || $mybb->cookies['acp_view'])
{
// We have a custom view

Zeile 2253Zeile 2315
		{
// We already have a cookie, so let's use it...
$mybb->input['vid'] = $mybb->cookies['acp_view'];

		{
// We already have a cookie, so let's use it...
$mybb->input['vid'] = $mybb->cookies['acp_view'];

		}


		}


		$vid_url = "&amp;vid=".$mybb->input['vid'];
}

		$vid_url = "&amp;vid=".$mybb->input['vid'];
}

	



	// First, collect the user IDs that we're performing the moderation on
$ids = explode("|", $mybb->cookies['inlinemod_useracp']);
foreach($ids as $id)

	// First, collect the user IDs that we're performing the moderation on
$ids = explode("|", $mybb->cookies['inlinemod_useracp']);
foreach($ids as $id)

	{

	{

		if($id != '')
{
$selected[] = intval($id);

		if($id != '')
{
$selected[] = intval($id);

Zeile 2274Zeile 2336
		if($mybb->input['inline_action'] != "multilift" && $mybb->request_method != "post")
{
$errors[] = $lang->error_inline_no_users_selected;

		if($mybb->input['inline_action'] != "multilift" && $mybb->request_method != "post")
{
$errors[] = $lang->error_inline_no_users_selected;

		}

		}

	}

	}

	



	if($errors)
{
// Don't show views, but show the user list if there's errors

	if($errors)
{
// Don't show views, but show the user list if there's errors

Zeile 2324Zeile 2386
				{
$sql_array = implode(",", $to_update);
$db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");

				{
$sql_array = implode(",", $to_update);
$db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");





					// Action complete, grab stats and show success message - redirect user
$to_update_count = count($to_update);
$lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));

if($to_update_count != count($selected))

					// Action complete, grab stats and show success message - redirect user
$to_update_count = count($to_update);
$lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));

if($to_update_count != count($selected))

					{

					{

						// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;
$lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count));
$lang->inline_activated = $lang->inline_activated."<br />".$lang->inline_activated_more; // Add these stats to the message

						// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;
$lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count));
$lang->inline_activated = $lang->inline_activated."<br />".$lang->inline_activated_more; // Add these stats to the message

					}


					}


					$mybb->input['action'] = "inline_activated"; // Force a change to the action so we can add it to the adminlog
log_admin_action($to_update_count); // Add to adminlog
my_unsetcookie("inlinemod_useracp"); // Unset the cookie, so that the users aren't still selected when we're redirected

flash_message($lang->inline_activated, 'success');

					$mybb->input['action'] = "inline_activated"; // Force a change to the action so we can add it to the adminlog
log_admin_action($to_update_count); // Add to adminlog
my_unsetcookie("inlinemod_useracp"); // Unset the cookie, so that the users aren't still selected when we're redirected

flash_message($lang->inline_activated, 'success');

					admin_redirect("index.php?module=user-users".$vid_url);
}

					admin_redirect("index.php?module=user-users".$vid_url);
}

				else
{
// Nothing was updated, show an error
flash_message($lang->inline_activated_failed, 'error');

				else
{
// Nothing was updated, show an error
flash_message($lang->inline_activated_failed, 'error');

					admin_redirect("index.php?module=user-users".$vid_url);
}

					admin_redirect("index.php?module=user-users".$vid_url);
}

				break;
case 'multilift':
// Get the users that are banned, and check that they have been selected

				break;
case 'multilift':
// Get the users that are banned, and check that they have been selected

Zeile 2368Zeile 2430
						$updated_group = array(
"usergroup" => $ban['oldgroup'],
"additionalgroups" => $ban['oldadditionalgroups'],

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

							"displaygroup" => $ban['olddisplaygroup']					

							"displaygroup" => $ban['olddisplaygroup']

						);
$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']."'");

Zeile 2376Zeile 2438

$cache->update_banned();
$cache->update_moderators();


$cache->update_banned();
$cache->update_moderators();





					$mybb->input['action'] = "inline_lift";
log_admin_action($to_be_unbanned);
my_unsetcookie("inlinemod_useracp");

$lang->success_ban_lifted = $lang->sprintf($lang->success_ban_lifted, my_number_format($to_be_unbanned));
flash_message($lang->success_ban_lifted, 'success');

					$mybb->input['action'] = "inline_lift";
log_admin_action($to_be_unbanned);
my_unsetcookie("inlinemod_useracp");

$lang->success_ban_lifted = $lang->sprintf($lang->success_ban_lifted, my_number_format($to_be_unbanned));
flash_message($lang->success_ban_lifted, 'success');

					admin_redirect("index.php?module=user-users".$vid_url);
}
else
{
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift", $lang->confirm_multilift);

					admin_redirect("index.php?module=user-users".$vid_url);
}
else
{
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift", $lang->confirm_multilift);

				}

break;

				}

break;

Zeile 2500Zeile 2562
				echo $form->generate_hidden_field('processed', '1');

$form_container = new FormContainer('<div class="float_right"><a href="index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift&amp;my_post_key='.$mybb->post_code.'">'.$lang->lift_bans.'</a></div>'.$lang->mass_ban);

				echo $form->generate_hidden_field('processed', '1');

$form_container = new FormContainer('<div class="float_right"><a href="index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift&amp;my_post_key='.$mybb->post_code.'">'.$lang->lift_bans.'</a></div>'.$lang->mass_ban);

				$form_container->output_row($lang->ban_reason, "", $form->generate_text_box('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');				

				$form_container->output_row($lang->ban_reason, "", $form->generate_text_box('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');

				$ban_times = fetch_ban_times();
foreach($ban_times as $time => $period)
{

				$ban_times = fetch_ban_times();
foreach($ban_times as $time => $period)
{

Zeile 2511Zeile 2573
					}
$length_list[$time] = $period;
}

					}
$length_list[$time] = $period;
}

				$form_container->output_row($lang->ban_time, "", $form->generate_select_box('bantime', $length_list, $mybb->input['bantime'], array('id' => 'bantime')), 'bantime');				

				$form_container->output_row($lang->ban_time, "", $form->generate_select_box('bantime', $length_list, $mybb->input['bantime'], array('id' => 'bantime')), 'bantime');

				$form_container->end();

				$form_container->end();

			



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

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

				$form->output_submit_wrapper($buttons);				

				$form->output_submit_wrapper($buttons);

				$form->end();
$page->output_footer();
break;

				$form->end();
$page->output_footer();
break;

Zeile 2537Zeile 2599
							if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
{
// Remove me and super admins

							if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
{
// Remove me and super admins

 
								--$to_be_deleted;

								continue;
}
else
{
// Run delete queries
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

								continue;
}
else
{
// Run delete queries
$db->update_query("posts", array('uid' => 0), "uid='{$user['uid']}'");

 
								$db->update_query("threads", array('uid' => 0), "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 2551Zeile 2615
								$db->delete_query("threadsubscriptions", "uid='{$user['uid']}'");
$db->delete_query("sessions", "uid='{$user['uid']}'");
$db->delete_query("banned", "uid='{$user['uid']}'");

								$db->delete_query("threadsubscriptions", "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("users", "uid='{$user['uid']}'");
$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");

 

// Update thread ratings
$update_thread_ratings_query = $db->query("
SELECT r.*, t.numratings, t.totalratings
FROM ".TABLE_PREFIX."threadratings r
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=r.tid)
WHERE r.uid='{$user['uid']}'
");
while($rating = $db->fetch_array($update_thread_ratings_query))
{
$update_thread = array(
"numratings" => $rating['numratings'] - 1,
"totalratings" => $rating['totalratings'] - $rating['rating']
);
$db->update_query("threads", $update_thread, "tid='{$rating['tid']}'");
}

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

							}
}
// Update forum stats, remove the cookie and redirect the user

							}
}
// Update forum stats, remove the cookie and redirect the user

Zeile 2660Zeile 2741
					{
$sql_array = implode(",", $selected);
$prune_array = array();

					{
$sql_array = implode(",", $selected);
$prune_array = array();

						$query = $db->simple_select("users", "uid", "uid IN (".$sql_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']))
{
continue;

						while($user = $db->fetch_array($query))
{
// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
{
continue;

							}

							}


$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete
if($return_array && is_array($return_array))
{
$prune_array = array_merge_recursive($prune_array, $return_array);


$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete
if($return_array && is_array($return_array))
{
$prune_array = array_merge_recursive($prune_array, $return_array);

							}

							}

						}

// No posts were found for the user, return error

						}

// No posts were found for the user, return error

Zeile 2691Zeile 2772
						if(is_array($prune_array['to_delete']) && count($prune_array['to_delete']) > 0)
{
foreach($prune_array['to_delete'] as $tid)

						if(is_array($prune_array['to_delete']) && count($prune_array['to_delete']) > 0)
{
foreach($prune_array['to_delete'] as $tid)

							{

							{

								$db->delete_query("threads", "tid='$tid'");
$db->delete_query("threads", "closed='moved|$tid'");
$db->delete_query("threadsubscriptions", "tid='$tid'");

								$db->delete_query("threads", "tid='$tid'");
$db->delete_query("threads", "closed='moved|$tid'");
$db->delete_query("threadsubscriptions", "tid='$tid'");

Zeile 2709Zeile 2790
							while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);

							while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);

							}

							}

						}

// After updating thread counters, update the affected forum counters

						}

// After updating thread counters, update the affected forum counters

Zeile 2738Zeile 2819

$page->output_header($lang->manage_users);
$page->output_nav_tabs($sub_tabs, 'manage_users');


$page->output_header($lang->manage_users);
$page->output_nav_tabs($sub_tabs, 'manage_users');

				



				// Display a table warning
$table = new Table;
$lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected));

				// Display a table warning
$table = new Table;
$lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected));

Zeile 2755Zeile 2836
				$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiprune');

				$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiprune');

				echo $form->generate_hidden_field('processed', '1');

$form_container = new FormContainer($lang->mass_prune_posts);


				echo $form->generate_hidden_field('processed', '1');

$form_container = new FormContainer($lang->mass_prune_posts);


				// Generate a list of days (1 - 31)
$day_options = array();
$day_options[] = "&nbsp;";

				// Generate a list of days (1 - 31)
$day_options = array();
$day_options[] = "&nbsp;";

Zeile 2780Zeile 2861
				$year_box = $form->generate_text_box('year', $mybb->input['year'], array('id' => 'year', 'style' => 'width: 50px;'));

$prune_select = $date_box.$month_box.$year_box;

				$year_box = $form->generate_text_box('year', $mybb->input['year'], array('id' => 'year', 'style' => 'width: 50px;'));

$prune_select = $date_box.$month_box.$year_box;

				$form_container->output_row($lang->manual_date, "", $prune_select, 'date');				

				$form_container->output_row($lang->manual_date, "", $prune_select, 'date');


// Generate the set date box
$set_options = array();


// Generate the set date box
$set_options = array();

Zeile 2791Zeile 2872
					$set_options[] = $lang->$string;
}


					$set_options[] = $lang->$string;
}


				$form_container->output_row($lang->relative_date, "", $lang->delete_posts." ".$form->generate_select_box('set', $set_options, $mybb->input['set']), 'set');				

				$form_container->output_row($lang->relative_date, "", $lang->delete_posts." ".$form->generate_select_box('set', $set_options, $mybb->input['set']), 'set');

				$form_container->end();

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

				$form_container->end();

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

				$form->output_submit_wrapper($buttons);				

				$form->output_submit_wrapper($buttons);

				$form->end();
$page->output_footer();
break;

				$form->end();
$page->output_footer();
break;

Zeile 2886Zeile 2967
				$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

				$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

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

					$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

				}

if(!is_array($mybb->input['additionalgroups']))

				}

if(!is_array($mybb->input['additionalgroups']))

Zeile 2897Zeile 2978

$form_container->output_row($lang->primary_user_group, "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
$form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups');


$form_container->output_row($lang->primary_user_group, "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
$form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups');

				$form_container->output_row($lang->display_user_group, "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');			

				$form_container->output_row($lang->display_user_group, "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');


$form_container->end();

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


$form_container->end();

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

				$form->output_submit_wrapper($buttons);				

				$form->output_submit_wrapper($buttons);

				$form->end();
$page->output_footer();
break;

				$form->end();
$page->output_footer();
break;

Zeile 2913Zeile 2994
if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_user_users_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_user_users_start");

	



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

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

	



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

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

	



	if(isset($mybb->input['search_id']) && $admin_session['data']['user_views'][$mybb->input['search_id']])
{
$admin_view = $admin_session['data']['user_views'][$mybb->input['search_id']];

	if(isset($mybb->input['search_id']) && $admin_session['data']['user_views'][$mybb->input['search_id']])
{
$admin_view = $admin_session['data']['user_views'][$mybb->input['search_id']];

Zeile 2933Zeile 3014
			$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']))

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

			{

			{

				unset($admin_view);
}
}

				unset($admin_view);
}
}

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

	}


	}


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


Zeile 2961Zeile 3042
	}
$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();





	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($admin_session['data']['from'] == "home")


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;

			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;

		else
{
$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)
{

Zeile 2997Zeile 3078
	}

echo $results;

	}

echo $results;





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 3009Zeile 3090
	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;
}

		



		$view_title .= " (".htmlspecialchars_uni($view['title']).")";
}

// Build the URL to this view
if(!isset($view['url']))

		$view_title .= " (".htmlspecialchars_uni($view['title']).")";
}

// Build the URL to this view
if(!isset($view['url']))

	{

	{

		$view['url'] = "index.php?module=user-users";
}
if(!is_array($view['conditions']))
{
$view['conditions'] = unserialize($view['conditions']);

		$view['url'] = "index.php?module=user-users";
}
if(!is_array($view['conditions']))
{
$view['conditions'] = unserialize($view['conditions']);

	}

	}

	if(!is_array($view['fields']))
{
$view['fields'] = unserialize($view['fields']);

	if(!is_array($view['fields']))
{
$view['fields'] = unserialize($view['fields']);

Zeile 3056Zeile 3137
		}
$view['url'] .= "&amp;search_id=".htmlspecialchars_uni($mybb->input['search_id']);
}

		}
$view['url'] .= "&amp;search_id=".htmlspecialchars_uni($mybb->input['search_id']);
}

	



	if(isset($mybb->input['username']))
{
$view['url'] .= "&amp;username=".urlencode(htmlspecialchars_uni($mybb->input['username']));

	if(isset($mybb->input['username']))
{
$view['url'] .= "&amp;username=".urlencode(htmlspecialchars_uni($mybb->input['username']));

	}


	}


	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']));
}

	



	if(isset($view['conditions']['referrer'])){
$view['url'] .= "&amp;action=referrers&amp;uid=".htmlspecialchars_uni($view['conditions']['referrer']);

	if(isset($view['conditions']['referrer'])){
$view['url'] .= "&amp;action=referrers&amp;uid=".htmlspecialchars_uni($view['conditions']['referrer']);

	}


	}


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

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

	
$table = new Table;


$table = new Table;


// Build header for table based view
if($view['view_type'] != "card")


// Build header for table based view
if($view['view_type'] != "card")

Zeile 3085Zeile 3166
		foreach($view['fields'] as $field)
{
if(!$user_view_fields[$field])

		foreach($view['fields'] as $field)
{
if(!$user_view_fields[$field])

			{

			{

				continue;
}
$view_field = $user_view_fields[$field];

				continue;
}
$view_field = $user_view_fields[$field];

Zeile 3099Zeile 3180
				$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

				$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

		}

		}

		$table->construct_header("<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this);\" />"); // Create a header for the "select" boxes
}


		$table->construct_header("<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this);\" />"); // Create a header for the "select" boxes
}


Zeile 3118Zeile 3199
		else if(!empty($view['conditions'][$search_field.'_blank']))
{
$search_sql .= " AND u.{$search_field} != ''";

		else if(!empty($view['conditions'][$search_field.'_blank']))
{
$search_sql .= " AND u.{$search_field} != ''";

		}
}

		}
}


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


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

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

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

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

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

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

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

Zeile 3223Zeile 3304
		$search_sql .= " AND u.uid IN(".implode(',', $ip_uids).")";
unset($ip_uids);
}

		$search_sql .= " AND u.uid IN(".implode(',', $ip_uids).")";
unset($ip_uids);
}

	



	// Custom Profile Field searching
if($view['custom_profile_fields'])
{

	// Custom Profile Field searching
if($view['custom_profile_fields'])
{

Zeile 3231Zeile 3312
		foreach($view['custom_profile_fields'] as $column => $input)
{
if(is_array($input))

		foreach($view['custom_profile_fields'] as $column => $input)
{
if(is_array($input))

			{

			{

				foreach($input as $value => $text)
{
if($value == $column)

				foreach($input as $value => $text)
{
if($value == $column)

					{

					{

						$value = $text;
}

if($value == $lang->na)
{
continue;

						$value = $text;
}

if($value == $lang->na)
{
continue;

					}

					}


if(strpos($column, '_blank') !== false)
{


if(strpos($column, '_blank') !== false)
{

Zeile 3253Zeile 3334
					{
$userfield_sql .= ' AND '.$db->escape_string($column)."='".$db->escape_string($value)."'";
}

					{
$userfield_sql .= ' AND '.$db->escape_string($column)."='".$db->escape_string($value)."'";
}

				}

				}

			}
else if(!empty($input))
{

			}
else if(!empty($input))
{

Zeile 3261Zeile 3342
				{
continue;
}

				{
continue;
}

				



				if(strpos($column, '_blank') !== false)
{
$column = str_replace('_blank', '', $column);

				if(strpos($column, '_blank') !== false)
{
$column = str_replace('_blank', '', $column);

Zeile 3298Zeile 3379
		foreach($view['conditions']['usergroup'] as $usergroup)
{
$usergroup = intval($usergroup);

		foreach($view['conditions']['usergroup'] as $usergroup)
{
$usergroup = intval($usergroup);

		



			if(!$usergroup)
{
continue;

			if(!$usergroup)
{
continue;

			}


			}


			switch($db->type)
{
case "pgsql":

			switch($db->type)
{
case "pgsql":

Zeile 3316Zeile 3397
		}

$search_sql .= " AND (u.usergroup IN (".implode(",", array_map('intval', $view['conditions']['usergroup'])).") {$additional_sql})";

		}

$search_sql .= " AND (u.usergroup IN (".implode(",", array_map('intval', $view['conditions']['usergroup'])).") {$additional_sql})";

	}


	}


	// COPPA users only?
if(isset($view['conditions']['coppa']))
{
$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";

	// COPPA users only?
if(isset($view['conditions']['coppa']))
{
$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";

	}

	}


// Extra SQL?
if(isset($view['extra_sql']))


// Extra SQL?
if(isset($view['extra_sql']))

Zeile 3337Zeile 3418
		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 3372Zeile 3453
			$start = 0;
$mybb->input['page'] = 1;
}

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

		



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

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

		



		switch($view['sortby'])
{
case "regdate":

		switch($view['sortby'])
{
case "regdate":

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

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

				break;			

				break;

			case "warninglevel":
$view['sortby'] = "warningpoints";
break;

			case "warninglevel":
$view['sortby'] = "warningpoints";
break;

Zeile 3403Zeile 3484
		}

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

		}

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

		



		// Fetch matching users
$query = $db->query("
SELECT u.*

		// Fetch matching users
$query = $db->query("
SELECT u.*

Zeile 3417Zeile 3498
		{
$comma = $groups_list = '';
$user['view']['username'] = "<a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$user['uid']}\">".format_name($user['username'], $user['usergroup'], $user['displaygroup'])."</a>";

		{
$comma = $groups_list = '';
$user['view']['username'] = "<a href=\"index.php?module=user-users&amp;action=edit&amp;uid={$user['uid']}\">".format_name($user['username'], $user['usergroup'], $user['displaygroup'])."</a>";

			$user['view']['usergroup'] = $usergroups[$user['usergroup']]['title'];

			$user['view']['usergroup'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']);

			if($user['additionalgroups'])
{
$additional_groups = explode(",", $user['additionalgroups']);

foreach($additional_groups as $group)
{

			if($user['additionalgroups'])
{
$additional_groups = explode(",", $user['additionalgroups']);

foreach($additional_groups as $group)
{

					$groups_list .= "{$comma}{$usergroups[$group]['title']}";

					$groups_list .= $comma.htmlspecialchars_uni($usergroups[$group]['title']);

					$comma = $lang->comma;
}
}

					$comma = $lang->comma;
}
}

Zeile 3515Zeile 3596
			$table->construct_row();
}
}

			$table->construct_row();
}
}

	



	if(!isset($view['table_id']))
{
$view['table_id'] = "users_list";

	if(!isset($view['table_id']))
{
$view['table_id'] = "users_list";

Zeile 3549Zeile 3630
		$search_class = '';
$search_style = "text-align: right;";
}

		$search_class = '';
$search_style = "text-align: right;";
}

	



	$search_action = $view['url'];
// stop &username= in the query string
if($view_upos = strpos($search_action, '&amp;username='))

	$search_action = $view['url'];
// stop &username= in the query string
if($view_upos = strpos($search_action, '&amp;username='))

Zeile 3612Zeile 3693
		}
</script>\n";
$built_view .= "</div>\n";

		}
</script>\n";
$built_view .= "</div>\n";

	



	// Autocompletion for usernames
$built_view .= '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>

	// Autocompletion for usernames
$built_view .= '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>

Zeile 3691Zeile 3772
		}

$view_field = $user_view_fields[$field];

		}

$view_field = $user_view_fields[$field];

		



		// Special conditions for avatar
if($field == "avatar")
{

		// Special conditions for avatar
if($field == "avatar")
{

Zeile 3707Zeile 3788
			if(isset($user['view'][$field]))
{
$value = $user['view'][$field];

			if(isset($user['view'][$field]))
{
$value = $user['view'][$field];

			}

			}

			else
{
$value = $user[$field];

			else
{
$value = $user[$field];

			}


			}


			if($field == "postnum")
{
$value = my_number_format($value);
}

			if($field == "postnum")
{
$value = my_number_format($value);
}

			



			$user_details[] = "<strong>{$view_field['title']}:</strong> {$value}";
}

}
// Floated to the left or right?
if($i == 1)

			$user_details[] = "<strong>{$view_field['title']}:</strong> {$value}";
}

}
// Floated to the left or right?
if($i == 1)

	{

	{

		$float = "left";
}
else

		$float = "left";
}
else

Zeile 3807Zeile 3888
function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false)
{
global $lang;

function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false)
{
global $lang;

	



	if(!is_array($fields))
{
return;
}
foreach($fields as $profile_field)
{

	if(!is_array($fields))
{
return;
}
foreach($fields as $profile_field)
{

 
		$profile_field['name'] = htmlspecialchars_uni($profile_field['name']);
$profile_field['description'] = htmlspecialchars_uni($profile_field['description']);

		$profile_field['type'] = htmlspecialchars_uni($profile_field['type']);
list($type, $options) = explode("\n", $profile_field['type'], 2);
$type = trim($type);
$field_name = "fid{$profile_field['fid']}";

		$profile_field['type'] = htmlspecialchars_uni($profile_field['type']);
list($type, $options) = explode("\n", $profile_field['type'], 2);
$type = trim($type);
$field_name = "fid{$profile_field['fid']}";





		switch($type)
{
case "multiselect":
if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);

		switch($type)
{
case "multiselect":
if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);

				}

				}

				else
{
$user_options = $values[$field_name];

				else
{
$user_options = $values[$field_name];

				}

				}


foreach($user_options as $val)
{


foreach($user_options as $val)
{

Zeile 3837Zeile 3920
				}

$select_options = explode("\n", $options);

				}

$select_options = explode("\n", $options);

				$options = array();
if($search == true)
{
$select_options[''] = $lang->na;
}

foreach($select_options as $val)
{
$val = trim($val);
$options[$val] = $val;
}
if(!$profile_field['length'])

				$options = array();
if($search == true)
{
$select_options[''] = $lang->na;
}

foreach($select_options as $val)
{
$val = trim($val);
$options[$val] = $val;
}
if(!$profile_field['length'])

				{
$profile_field['length'] = 3;
}

				{
$profile_field['length'] = 3;
}

Zeile 3876Zeile 3959
					$code = $form->generate_select_box("profile_fields[{$field_name}][{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
}
else

					$code = $form->generate_select_box("profile_fields[{$field_name}][{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
}
else

				{

				{

					$code = $form->generate_select_box("profile_fields[{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
}
break;
case "radio":
$radio_options = array();
if($search == true)

					$code = $form->generate_select_box("profile_fields[{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
}
break;
case "radio":
$radio_options = array();
if($search == true)

				{

				{

					$radio_options[''] = $lang->na;
}
$radio_options += explode("\n", $options);

					$radio_options[''] = $lang->na;
}
$radio_options += explode("\n", $options);

Zeile 3897Zeile 3980
				if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);

				if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);

				}

				}

				else

				else

				{

				{

					$user_options = $values[$field_name];
}
foreach($user_options as $val)
{
$selected_options[$val] = $val;

					$user_options = $values[$field_name];
}
foreach($user_options as $val)
{
$selected_options[$val] = $val;

				}

				}

				$select_options = array();
if($search == true)
{

				$select_options = array();
if($search == true)
{

Zeile 3919Zeile 4002
				}
break;
case "textarea":

				}
break;
case "textarea":

				$extra = '';

				$extra = '';

				if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{
$extra = " {$lang->or} ".$form->generate_check_box("profile_fields[{$field_name}_blank]", 1, $lang->is_not_blank, array('id' => "{$field_name}_blank", 'checked' => $values[$field_name.'_blank']));
}

$code = $form->generate_text_area("profile_fields[{$field_name}]", $values[$field_name], array('id' => "profile_field_{$field_name}", 'rows' => 6, 'cols' => 50)).$extra;

				if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{
$extra = " {$lang->or} ".$form->generate_check_box("profile_fields[{$field_name}_blank]", 1, $lang->is_not_blank, array('id' => "{$field_name}_blank", 'checked' => $values[$field_name.'_blank']));
}

$code = $form->generate_text_area("profile_fields[{$field_name}]", $values[$field_name], array('id' => "profile_field_{$field_name}", 'rows' => 6, 'cols' => 50)).$extra;

				break;

				break;

			default:
$extra = '';
if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{
$extra = " {$lang->or} ".$form->generate_check_box("profile_fields[{$field_name}_blank]", 1, $lang->is_not_blank, array('id' => "{$field_name}_blank", 'checked' => $values[$field_name.'_blank']));
}

			default:
$extra = '';
if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{
$extra = " {$lang->or} ".$form->generate_check_box("profile_fields[{$field_name}_blank]", 1, $lang->is_not_blank, array('id' => "{$field_name}_blank", 'checked' => $values[$field_name.'_blank']));
}





				$code = $form->generate_text_box("profile_fields[{$field_name}]", $values[$field_name], array('id' => "profile_field_{$field_name}", 'maxlength' => $profile_field['maxlength'], 'length' => $profile_field['length'])).$extra;
break;
}

$form_container->output_row($profile_field['name'], $profile_field['description'], $code, "", array('id' => "profile_field_{$field_name}"));
$code = $user_options = $selected_options = $radio_options = $val = $options = '';

				$code = $form->generate_text_box("profile_fields[{$field_name}]", $values[$field_name], array('id' => "profile_field_{$field_name}", 'maxlength' => $profile_field['maxlength'], 'length' => $profile_field['length'])).$extra;
break;
}

$form_container->output_row($profile_field['name'], $profile_field['description'], $code, "", array('id' => "profile_field_{$field_name}"));
$code = $user_options = $selected_options = $radio_options = $val = $options = '';

	}

	}

}

function user_search_conditions($input=array(), &$form)

}

function user_search_conditions($input=array(), &$form)

Zeile 3951Zeile 4034
	{
$input = $mybb->input;
}

	{
$input = $mybb->input;
}

	



	if(!is_array($input['conditions']))
{
$input['conditions'] = unserialize($input['conditions']);

	if(!is_array($input['conditions']))
{
$input['conditions'] = unserialize($input['conditions']);

	}


	}


	if(!is_array($input['profile_fields']))

	if(!is_array($input['profile_fields']))

	{

	{

		$input['profile_fields'] = unserialize($input['profile_fields']);
}

		$input['profile_fields'] = unserialize($input['profile_fields']);
}

	



	if(!is_array($input['fields']))
{
$input['fields'] = unserialize($input['fields']);

	if(!is_array($input['fields']))
{
$input['fields'] = unserialize($input['fields']);

	}


	}


	$form_container = new FormContainer($lang->find_users_where);
$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
$form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');

	$form_container = new FormContainer($lang->find_users_where);
$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
$form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');

Zeile 3975Zeile 4058
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

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

		$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');

	}

$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');

Zeile 4000Zeile 4083
	$form_container->output_row($lang->posted_with_ip, $lang->wildcard, $form->generate_text_box('conditions[postip]', $input['conditions']['postip'], array('id' => 'postip')), 'postip');

$form_container->end();

	$form_container->output_row($lang->posted_with_ip, $lang->wildcard, $form->generate_text_box('conditions[postip]', $input['conditions']['postip'], array('id' => 'postip')), 'postip');

$form_container->end();

	



	// Custom profile fields go here
$form_container = new FormContainer($lang->custom_profile_fields_match);

	// Custom profile fields go here
$form_container = new FormContainer($lang->custom_profile_fields_match);

	



	// Fetch custom profile fields
$query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
while($profile_field = $db->fetch_array($query))

	// Fetch custom profile fields
$query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
while($profile_field = $db->fetch_array($query))

	{		

	{

		if($profile_field['required'] == 1)
{
$profile_fields['required'][] = $profile_field;

		if($profile_field['required'] == 1)
{
$profile_fields['required'][] = $profile_field;

Zeile 4017Zeile 4100
			$profile_fields['optional'][] = $profile_field;
}
}

			$profile_fields['optional'][] = $profile_field;
}
}

	



	output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true);
output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);

	output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true);
output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);

	



	$form_container->end();

	$form_container->end();

	



	// Autocompletion for usernames
echo '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>

	// Autocompletion for usernames
echo '
<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>