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

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

	$plugins->run_hooks("admin_user_users_coppa_activate_commit");





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


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


Zeile 406Zeile 406
		if($user['coppauser'])
{
$message = $lang->success_coppa_activated;

		if($user['coppauser'])
{
$message = $lang->success_coppa_activated;

		}
else

		}
else

		{
$message = $lang->success_activated;
}

		{
$message = $lang->success_activated;
}

		



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

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

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

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

		}

		}

	}

	}

	



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

	if($admin_session['data']['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');

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

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

	



	admin_redirect($url);
}

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

	admin_redirect($url);
}

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

	



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

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

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

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


// Set the data for the new user.


// Set the data for the new user.

		$new_user = array(
"uid" => $mybb->input['uid'],
"username" => $mybb->input['username'],

		$new_user = array(
"uid" => $mybb->input['uid'],
"username" => $mybb->input['username'],

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

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





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

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

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

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

	{

	{

		$page->output_inline_error($errors);
}
else
{
$mybb->input = array(
"usergroup" => 2

		$page->output_inline_error($errors);
}
else
{
$mybb->input = array(
"usergroup" => 2

		);

		);

	}

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

	}

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

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

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





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

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

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 591Zeile 591
		if(is_array($mybb->input['additionalgroups']))
{
foreach($mybb->input['additionalgroups'] as $key => $gid)

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

			{

			{

				if($gid == $mybb->input['usergroup'])
{
unset($mybb->input['additionalgroups'][$key]);

				if($gid == $mybb->input['usergroup'])
{
unset($mybb->input['additionalgroups'][$key]);

Zeile 620Zeile 620
			"postnum" => $mybb->input['postnum'],
"usertitle" => $mybb->input['usertitle'],
"timezone" => $mybb->input['timezone'],

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

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

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

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

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

Zeile 649Zeile 649
			}
}
if($mybb->input['new_password'])

			}
}
if($mybb->input['new_password'])

		{

		{

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

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

Zeile 676Zeile 676
		if($mybb->settings['usertppoptions'])
{
$updated_user['options']['tpp'] = intval($mybb->input['tpp']);

		if($mybb->settings['usertppoptions'])
{
$updated_user['options']['tpp'] = intval($mybb->input['tpp']);

		}

		}


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


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

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 767Zeile 767
					{
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))

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

						{

						{

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

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

				



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

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

Zeile 846Zeile 846
					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 864
						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 887
			{
$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 896
					);
$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 931Zeile 931
		// We need to fetch this users profile field values
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
$mybb->input['profile_fields'] = $db->fetch_array($query);

		// We need to fetch this users profile field values
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
$mybb->input['profile_fields'] = $db->fetch_array($query);

	}


	}


	if($mybb->input['bday1'] || $mybb->input['bday2'] || $mybb->input['bday3'])
{
$mybb->input['bday'][0] = $mybb->input['bday1'];

	if($mybb->input['bday1'] || $mybb->input['bday2'] || $mybb->input['bday3'])
{
$mybb->input['bday'][0] = $mybb->input['bday1'];

Zeile 946Zeile 946
		if($user['birthday'])
{
$mybb->input['bday'] = explode('-', $user['birthday']);

		if($user['birthday'])
{
$mybb->input['bday'] = explode('-', $user['birthday']);

		}

		}

	}

// Fetch custom profile fields

	}

// Fetch custom profile fields

Zeile 965Zeile 965

$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 981
	{
$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 1063Zeile 1063
		if($posts_per_day > $user['postnum'])
{
$posts_per_day = $user['postnum'];

		if($posts_per_day > $user['postnum'])
{
$posts_per_day = $user['postnum'];

		}
}

		}
}

	$stats = $cache->read("stats");
$posts = $stats['numposts'];
if($posts == 0)

	$stats = $cache->read("stats");
$posts = $stats['numposts'];
if($posts == 0)

	{

	{

		$percent_posts = "0";

		$percent_posts = "0";

	}
else
{

	}
else
{

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


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


Zeile 1086Zeile 1086
	else
{
$reputation = "-";

	else
{
$reputation = "-";

	}

	}


if($mybb->settings['enablewarningsystem'] != 0 && $user_permissions['canreceivewarnings'] != 0)
{


if($mybb->settings['enablewarningsystem'] != 0 && $user_permissions['canreceivewarnings'] != 0)
{

Zeile 1123Zeile 1123
	$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 1146Zeile 1146
		$options[$usergroup['gid']] = $usergroup['title'];
$display_group_options[$usergroup['gid']] = $usergroup['title'];
}

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

	



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

	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 1165
	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 1226
	{
$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 1494Zeile 1494

$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 1517
	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 1594Zeile 1594
<!--

function toggleBox(action)

<!--

function toggleBox(action)

{

{

	if(action == "modpost")
{
$("suspendposting").checked = false;
$("suspost").hide();

	if(action == "modpost")
{
$("suspendposting").checked = false;
$("suspost").hide();

		



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

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

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

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

		}		

		}

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

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

Zeile 1617Zeile 1617
		if($("suspendposting").checked == true)
{
$("suspost").show();

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

		}

		}

		else if($("suspendposting").checked == false)
{
$("suspost").hide();
}
}

		else if($("suspendposting").checked == false)
{
$("suspost").hide();
}
}

}


}


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

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

Zeile 1645Zeile 1645

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

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


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


	// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=user-users");
}

	// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=user-users");
}





	if($mybb->request_method == "post")
{
// Delete the user

	if($mybb->request_method == "post")
{
// Delete the user

Zeile 1707Zeile 1707
		{
// Removes the ./ at the beginning the timestamp on the end...
@unlink("../".substr($user['avatar'], 2, -20));

		{
// Removes the ./ at the beginning the timestamp on the end...
@unlink("../".substr($user['avatar'], 2, -20));

		}


		}


		// Was this user a moderator?
if(is_moderator($user['uid']))
{
$db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'");
$cache->update_moderators();

		// Was this user a moderator?
if(is_moderator($user['uid']))
{
$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
{
$page->output_confirm_action("index.php?module=user-users&action=delete&uid={$user['uid']}", $lang->user_deletion_confirmation);

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

Zeile 1733Zeile 1733
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)

	{

	{

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

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

Zeile 1758Zeile 1758
	{
$admin_view['view_type'] = $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 1775
	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 1814
	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 1822
		$controls = $popup->fetch();
}
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> {$user['lastip']}");

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

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


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


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

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

Zeile 1842Zeile 1842
	$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))

	{

	{

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

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

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

	$page->output_footer();
}





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

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 1885Zeile 1885
		{
$errors[] = $lang->error_invalid_user_destination;
}

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

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

Zeile 1897Zeile 1897
		{
$errors[] = $lang->error_cannot_merge_same_account;
}

		{
$errors[] = $lang->error_cannot_merge_same_account;
}





		if(empty($errors))
{
// Begin to merge the accounts

		if(empty($errors))
{
// Begin to merge the accounts

Zeile 1911Zeile 1911
			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 1926
			$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 1939
				// 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 1992
			$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 2023

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

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

			$db->update_query("privatemessages", $to_uid, "toid='{$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 2048
			{
$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 2062
				"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 2070
			}

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 2085

$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 2119
}

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 2133
			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 2139Zeile 2158

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


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





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

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

		



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

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

		{

		{

			$admin_view['conditions'] = $mybb->input['conditions'];
}

			$admin_view['conditions'] = $mybb->input['conditions'];
}

		



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

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

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

		{

		{

			$admin_view['sortorder'] = $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'];

		}


		}


		$results = build_users_view($admin_view);

if($results)

		$results = build_users_view($admin_view);

if($results)

Zeile 2202Zeile 2221

$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 2229
	{
$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";

	}

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

	}

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


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



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


Zeile 2233Zeile 2252
	$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();
}


	$page->output_footer();
}


Zeile 2245Zeile 2264
	{
// We have a custom view
if(!$mybb->cookies['acp_view'])

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

		{

		{

			// Set a cookie
my_setcookie("acp_view", $mybb->input['vid'], 60);
}

			// Set a cookie
my_setcookie("acp_view", $mybb->input['vid'], 60);
}

Zeile 2257Zeile 2276

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

Zeile 2276Zeile 2295
			$errors[] = $lang->error_inline_no_users_selected;
}
}

			$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 2349Zeile 2368
					// Nothing was updated, show an error
flash_message($lang->inline_activated_failed, 'error');
admin_redirect("index.php?module=user-users".$vid_url);

					// Nothing was updated, show an error
flash_message($lang->inline_activated_failed, 'error');
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 2387
						$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 2500Zeile 2519
				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 2530
					}
$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 2660Zeile 2679
					{
$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 2710
						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 2728
							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 2757

$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 2774
				$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 2799
				$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 2810
					$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 2897Zeile 2916

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

		}
}
}


		}
}
}


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 3009Zeile 3028
	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 3075
		}
$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;

// Build header for table based view

	$table = new Table;

// Build header for table based view

Zeile 3176Zeile 3195
			{
$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";

			{
$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";

			}
else
{

			}
else
{

				$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
if(!is_array($ip_range))
{

				$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
if(!is_array($ip_range))
{

Zeile 3206Zeile 3225
		{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);
if(!is_array($ip_range))

		{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);
if(!is_array($ip_range))

			{

			{

				$ip_sql = "longipaddress='{$ip_range}'";
}
else

				$ip_sql = "longipaddress='{$ip_range}'";
}
else

Zeile 3223Zeile 3242
		$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 3261Zeile 3280
				{
continue;
}

				{
continue;
}

				



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

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

Zeile 3271Zeile 3290
				{
$userfield_sql .= ' AND '.$db->escape_string($column)." LIKE '%".$db->escape_string($input)."%'";
}

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

			}
}

			}
}


if($userfield_sql != '1=1')
{


if($userfield_sql != '1=1')
{

Zeile 3289Zeile 3308

// Usergroup based searching
if(isset($view['conditions']['usergroup']))


// Usergroup based searching
if(isset($view['conditions']['usergroup']))

	{

	{

		if(!is_array($view['conditions']['usergroup']))
{
$view['conditions']['usergroup'] = array($view['conditions']['usergroup']);

		if(!is_array($view['conditions']['usergroup']))
{
$view['conditions']['usergroup'] = array($view['conditions']['usergroup']);

Zeile 3298Zeile 3317
		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)
{


switch($db->type)
{

Zeile 3337Zeile 3356
		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 3391
			$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'])

		switch($view['sortby'])

		{

		{

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

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

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

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

				break;			

				break;

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

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

		}

		}


if($view['sortorder'] != "desc")
{


if($view['sortorder'] != "desc")
{

Zeile 3403Zeile 3422
		}

$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 3515Zeile 3534
			$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 3568
		$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 3585Zeile 3604
			{
search.focus();
return false;

			{
search.focus();
return false;

			}
}

			}
}


var search = document.getElementById('search_keywords');
search.onfocus = function()


var search = document.getElementById('search_keywords');
search.onfocus = function()

Zeile 3607Zeile 3626
		}
// fix the styling used if we have a different default value
if(search.value != '".addcslashes($lang->search_for_user, "'")."')

		}
// fix the styling used if we have a different default value
if(search.value != '".addcslashes($lang->search_for_user, "'")."')

		{

		{

			$(search).removeClassName('search_default');
}
</script>\n";
$built_view .= "</div>\n";

			$(search).removeClassName('search_default');
}
</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 3710
		}

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

		{

		{

			$avatar = $user['view']['avatar'];
}
else if($field == "controls")

			$avatar = $user['view']['avatar'];
}
else if($field == "controls")

Zeile 3709Zeile 3728
				$value = $user['view'][$field];
}
else

				$value = $user['view'][$field];
}
else

			{

			{

				$value = $user[$field];
}

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


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


Zeile 3782Zeile 3801
	$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('uid_{$user['uid']}').toggleClassName('inline_selected');\" />");

$table->construct_row();

	$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('uid_{$user['uid']}').toggleClassName('inline_selected');\" />");

$table->construct_row();

}

}


function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{


function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{

Zeile 3807Zeile 3826
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))

	if(!is_array($fields))

	{

	{

		return;
}
foreach($fields as $profile_field)

		return;
}
foreach($fields as $profile_field)

Zeile 3823Zeile 3842
		{
case "multiselect":
if(!is_array($values[$field_name]))

		{
case "multiselect":
if(!is_array($values[$field_name]))

				{

				{

					$user_options = explode("\n", $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)

				{

				{

					$selected_options[$val] = $val;
}

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

					$selected_options[$val] = $val;
}

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

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

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

				}

				}

				



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

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

Zeile 3951Zeile 3970
	{
$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']))
{
$input['profile_fields'] = unserialize($input['profile_fields']);
}

	if(!is_array($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 3976Zeile 3995
	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = $usergroup['title'];

	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = $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 4019
	$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 4036
			$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>