Vergleich admin/modules/user/users.php - 1.8.0 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 243Zeile 243
	{
$updated_user['usergroup'] = 2;
}

	{
$updated_user['usergroup'] = 2;
}

 

$plugins->run_hooks("admin_user_users_coppa_activate_commit");


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

$cache->update_awaitingactivation();


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

$cache->update_awaitingactivation();


$plugins->run_hooks("admin_user_users_coppa_activate_commit");

 

$message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);


$message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);

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

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

		}
else

		}
else

		{
$message = $lang->success_activated;
}

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

		{
$message = $lang->success_activated;
}

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

	}

	}

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

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

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

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

	}

$plugins->run_hooks("admin_user_users_coppa_end");


	}

$plugins->run_hooks("admin_user_users_coppa_end");


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

Zeile 345Zeile 345

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


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

		$errors = '';

// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

		$errors = '';

// Validate the user and get any errors that might have occurred.
if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

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

$plugins->run_hooks("admin_user_users_add_commit");

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

$plugins->run_hooks("admin_user_users_add_commit");





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

flash_message($lang->success_user_created, 'success');
admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
}

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

flash_message($lang->success_user_created, 'success');
admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
}

	}

	}


// Fetch custom profile fields - only need required profile fields here
$query = $db->simple_select("profilefields", "*", "required=1", array('order_by' => 'disporder'));


// Fetch custom profile fields - only need required profile fields here
$query = $db->simple_select("profilefields", "*", "required=1", array('order_by' => 'disporder'));

Zeile 377Zeile 377

$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&action=add", "post");

	$form = new Form("index.php?module=user-users&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

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

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

	$options = array();
$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->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." <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');

Zeile 425Zeile 425
if($mybb->input['action'] == "edit")
{
$user = get_user($mybb->input['uid']);

if($mybb->input['action'] == "edit")
{
$user = get_user($mybb->input['uid']);





	// Does the user not exist?
if(!$user['uid'])
{
flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=user-users");
}

	// Does the user not exist?
if(!$user['uid'])
{
flash_message($lang->error_invalid_user, 'error');
admin_redirect("index.php?module=user-users");
}





	$plugins->run_hooks("admin_user_users_edit");

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

	$plugins->run_hooks("admin_user_users_edit");

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

Zeile 445Zeile 445

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


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

		{

		{

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

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

Zeile 458Zeile 458
		else
{
$additionalgroups = '';

		else
{
$additionalgroups = '';

		}

		}


$returndate = "";
if(!empty($mybb->input['away_day']))


$returndate = "";
if(!empty($mybb->input['away_day']))

Zeile 476Zeile 476

$return_month = (int)substr($mybb->input['away_month'], 0, 2);
$return_day = (int)substr($mybb->input['away_day'], 0, 2);


$return_month = (int)substr($mybb->input['away_month'], 0, 2);
$return_day = (int)substr($mybb->input['away_day'], 0, 2);

			$return_year = min((int)$mybb->input['away_year'], 9999);

			$return_year = min($mybb->get_input('away_year', MyBB::INPUT_INT), 9999);


// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);


// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);

Zeile 522Zeile 522
			),
"style" => $mybb->input['style'],
"signature" => $mybb->input['signature'],

			),
"style" => $mybb->input['style'],
"signature" => $mybb->input['signature'],

			"dateformat" => (int)$mybb->input['dateformat'],
"timeformat" => (int)$mybb->input['timeformat'],
"language" => $mybb->input['language'],

			"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),
"timeformat" => $mybb->get_input('timeformat', MyBB::INPUT_INT),


			"usernotes" => $mybb->input['usernotes'],
"away" => array(
"away" => $mybb->input['away'],

			"usernotes" => $mybb->input['usernotes'],
"away" => array(
"away" => $mybb->input['away'],

Zeile 567Zeile 566
			"showcodebuttons" => $mybb->input['showcodebuttons'],
"sourceeditor" => $mybb->input['sourceeditor'],
"pmnotify" => $mybb->input['pmnotify'],

			"showcodebuttons" => $mybb->input['showcodebuttons'],
"sourceeditor" => $mybb->input['sourceeditor'],
"pmnotify" => $mybb->input['pmnotify'],

 
			"buddyrequestspm" => $mybb->input['buddyrequestspm'],
"buddyrequestsauto" => $mybb->input['buddyrequestsauto'],

			"showredirect" => $mybb->input['showredirect']
);

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

			"showredirect" => $mybb->input['showredirect']
);

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

			$updated_user['options']['tpp'] = (int)$mybb->input['tpp'];

			$updated_user['options']['tpp'] = $mybb->get_input('tpp', MyBB::INPUT_INT);

		}

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

		}

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

			$updated_user['options']['ppp'] = (int)$mybb->input['ppp'];

			$updated_user['options']['ppp'] = $mybb->get_input('ppp', MyBB::INPUT_INT);

		}

// Set the data of the user in the datahandler.

		}

// Set the data of the user in the datahandler.

Zeile 644Zeile 645
					$maxheight = (int)$maxwidth;

$extra_user_updates = array(

					$maxheight = (int)$maxwidth;

$extra_user_updates = array(

						"avatar" => "http://www.gravatar.com/avatar/{$email}{$s}",

						"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",

						"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

						"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

Zeile 652Zeile 653
				else
{
$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);

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

					$mybb->input['avatar_url'] = htmlspecialchars($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 679Zeile 679
							if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

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

							}
}
}


							}
}
}


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

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

Zeile 829Zeile 829
				}

$plugins->run_hooks("admin_user_users_edit_commit");

				}

$plugins->run_hooks("admin_user_users_edit_commit");

 

if($user['usergroup'] == 5 && $mybb->input['usergroup'] != 5)
{
$cache->update_awaitingactivation();
}


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


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

Zeile 868Zeile 873
	{
$mybb->input['bday'][0] = $mybb->input['bday1'];
$mybb->input['bday'][1] = $mybb->input['bday2'];

	{
$mybb->input['bday'][0] = $mybb->input['bday1'];
$mybb->input['bday'][1] = $mybb->input['bday2'];

		$mybb->input['bday'][2] = (int)$mybb->input['bday3'];

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

	}
else
{

	}
else
{

Zeile 882Zeile 887

if($mybb->input['away_day'] || $mybb->input['away_month'] || $mybb->input['away_year'])
{


if($mybb->input['away_day'] || $mybb->input['away_month'] || $mybb->input['away_year'])
{

		$mybb->input['away_year'] = (int)$mybb->input['away_year'];

		$mybb->input['away_year'] = $mybb->get_input('away_year', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 917Zeile 922
	$page->extra_header .= <<<EOF

<link rel="stylesheet" href="../jscripts/sceditor/editor_themes/mybb.css" type="text/css" media="all" />

	$page->extra_header .= <<<EOF

<link rel="stylesheet" href="../jscripts/sceditor/editor_themes/mybb.css" type="text/css" media="all" />

	<script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js"></script>
<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js"></script>


	<script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1805"></script>
<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1804"></script>
<script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>

EOF;
$page->output_header($lang->edit_user);


EOF;
$page->output_header($lang->edit_user);


Zeile 1009Zeile 1015
	else
{
$timezone = $user['timezone'];

	else
{
$timezone = $user['timezone'];

	}

	}

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


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


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

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

		}
}

		}
}

	$posts_per_day = my_number_format($posts_per_day);

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

	$posts_per_day = my_number_format($posts_per_day);

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

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

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

	}


	}


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

// Fetch the reputation for this user
if($user_permissions['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
{
$reputation = get_reputation($user['reputation']);

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

// Fetch the reputation for this user
if($user_permissions['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
{
$reputation = get_reputation($user['reputation']);

	}

	}

	else
{
$reputation = "-";
}

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

	else
{
$reputation = "-";
}

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

	{






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


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

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

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

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

	}


	}


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

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

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

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

	$table->construct_cell("<strong>{$lang->registration_date}:</strong> {$reg_date}");
$table->construct_cell("<strong>{$lang->local_time}:</strong> {$localtime}");
$table->construct_row();

	$table->construct_cell("<strong>{$lang->registration_date}:</strong> {$reg_date}");
$table->construct_cell("<strong>{$lang->local_time}:</strong> {$localtime}");
$table->construct_row();

Zeile 1089Zeile 1100

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


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


//


//

	// PROFILE
//
echo "<div id=\"tab_profile\">\n";

	// PROFILE
//
echo "<div id=\"tab_profile\">\n";

Zeile 1106Zeile 1117
	$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 1118Zeile 1129
	$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');

	$form_container->output_row($lang->post_count." <em>*</em>", "", $form->generate_text_box('postnum', $mybb->input['postnum'], array('id' => 'postnum')), 'postnum');
$form_container->output_row($lang->thread_count." <em>*</em>", "", $form->generate_text_box('threadnum', $mybb->input['threadnum'], array('id' => 'threadnum')), 'threadnum');


	$form_container->output_row($lang->post_count." <em>*</em>", "", $form->generate_numeric_field('postnum', $mybb->input['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum');
$form_container->output_row($lang->thread_count." <em>*</em>", "", $form->generate_numeric_field('threadnum', $mybb->input['threadnum'], array('id' => 'threadnum', 'min' => 0)), 'threadnum');


	// Output custom profile fields - required
if(!isset($profile_fields['required']))
{

	// Output custom profile fields - required
if(!isset($profile_fields['required']))
{

Zeile 1133Zeile 1144
	$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');

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

	$form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');

	$form_container->output_row($lang->aim_handle, "", $form->generate_text_box('aim', $mybb->input['aim'], array('id' => 'aim')), 'aim');
$form_container->output_row($lang->yahoo_messanger_handle, "", $form->generate_text_box('yahoo', $mybb->input['yahoo'], array('id' => 'yahoo')), 'yahoo');
$form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->input['skype'], array('id' => 'skype')), 'skype');

	$form_container->output_row($lang->aim_handle, "", $form->generate_text_box('aim', $mybb->input['aim'], array('id' => 'aim')), 'aim');
$form_container->output_row($lang->yahoo_messanger_handle, "", $form->generate_text_box('yahoo', $mybb->input['yahoo'], array('id' => 'yahoo')), 'yahoo');
$form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->input['skype'], array('id' => 'skype')), 'skype');

Zeile 1164Zeile 1175

$birthday_row = $form->generate_select_box('bday1', $birthday_days, $mybb->input['bday'][0], array('id' => 'bday_day'));
$birthday_row .= ' '.$form->generate_select_box('bday2', $birthday_months, $mybb->input['bday'][1], array('id' => 'bday_month'));


$birthday_row = $form->generate_select_box('bday1', $birthday_days, $mybb->input['bday'][0], array('id' => 'bday_day'));
$birthday_row .= ' '.$form->generate_select_box('bday2', $birthday_months, $mybb->input['bday'][1], array('id' => 'bday_month'));

	$birthday_row .= ' '.$form->generate_text_box('bday3', $mybb->input['bday'][2], array('id' => 'bday_year', 'style' => 'width: 3em;'));

	$birthday_row .= ' '.$form->generate_numeric_field('bday3', $mybb->input['bday'][2], array('id' => 'bday_year', 'style' => 'width: 4em;', 'min' => 0));


$form_container->output_row($lang->birthday, "", $birthday_row, 'birthday');



$form_container->output_row($lang->birthday, "", $birthday_row, 'birthday');


Zeile 1188Zeile 1199
		//Return date (we can use the arrays from birthday)
$return_row = $form->generate_select_box('away_day', $birthday_days, $mybb->input['away_day'], array('id' => 'away_day'));
$return_row .= ' '.$form->generate_select_box('away_month', $birthday_months, $mybb->input['away_month'], array('id' => 'away_month'));

		//Return date (we can use the arrays from birthday)
$return_row = $form->generate_select_box('away_day', $birthday_days, $mybb->input['away_day'], array('id' => 'away_day'));
$return_row .= ' '.$form->generate_select_box('away_month', $birthday_months, $mybb->input['away_month'], array('id' => 'away_month'));

		$return_row .= ' '.$form->generate_text_box('away_year', $mybb->input['away_year'], array('id' => 'away_year', 'style' => 'width: 3em;'));

		$return_row .= ' '.$form->generate_numeric_field('away_year', $mybb->input['away_year'], array('id' => 'away_year', 'style' => 'width: 4em;', 'min' => 0));


$form_container->output_row($lang->return_date, $lang->return_date_desc, $return_row, 'away_date');



$form_container->output_row($lang->return_date, $lang->return_date_desc, $return_row, 'away_date');


Zeile 1222Zeile 1233
		$form->generate_check_box("receivefrombuddy", 1, $lang->recieve_pms_from_buddy, array("checked" => $mybb->input['receivefrombuddy'])),
$form->generate_check_box("pmnotice", 1, $lang->alert_new_pms, array("checked" => $mybb->input['pmnotice'])),
$form->generate_check_box("pmnotify", 1, $lang->email_notify_new_pms, array("checked" => $mybb->input['pmnotify'])),

		$form->generate_check_box("receivefrombuddy", 1, $lang->recieve_pms_from_buddy, array("checked" => $mybb->input['receivefrombuddy'])),
$form->generate_check_box("pmnotice", 1, $lang->alert_new_pms, array("checked" => $mybb->input['pmnotice'])),
$form->generate_check_box("pmnotify", 1, $lang->email_notify_new_pms, array("checked" => $mybb->input['pmnotify'])),

 
		$form->generate_check_box("buddyrequestspm", 1, $lang->buddy_requests_pm, array("checked" => $mybb->input['buddyrequestspm'])),
$form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->input['buddyrequestsauto'])),

		"<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_email_notification, $lang->instant_email_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
);
$form_container->output_row($lang->messaging_and_notification, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $messaging_options)."</div>");

		"<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_email_notification, $lang->instant_email_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
);
$form_container->output_row($lang->messaging_and_notification, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $messaging_options)."</div>");

Zeile 1230Zeile 1243
	foreach($date_formats as $key => $format)
{
$date_format_options[$key] = my_date($format, TIME_NOW, "", 0);

	foreach($date_formats as $key => $format)
{
$date_format_options[$key] = my_date($format, TIME_NOW, "", 0);

	}


	}


	$time_format_options = array($lang->use_default);
foreach($time_formats as $key => $format)
{

	$time_format_options = array($lang->use_default);
foreach($time_formats as $key => $format)
{

Zeile 1246Zeile 1259
	);
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");


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






	$tpp_options = array($lang->use_default);
if($mybb->settings['usertppoptions'])
{

	$tpp_options = array($lang->use_default);
if($mybb->settings['usertppoptions'])
{

Zeile 1272Zeile 1285
		100 => $lang->show_threads_last_100_days,
365 => $lang->show_threads_last_year,
9999 => $lang->show_all_threads

		100 => $lang->show_threads_last_100_days,
365 => $lang->show_threads_last_year,
9999 => $lang->show_all_threads

	);

	);


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


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

Zeile 1285Zeile 1298
	{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))

	{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))

		{

		{

			foreach($explodedppp as $ppp)
{
if($ppp <= 0) continue;
$ppp_options[$ppp] = $ppp;
}
}

			foreach($explodedppp as $ppp)
{
if($ppp <= 0) continue;
$ppp_options[$ppp] = $ppp;
}
}

	}

	}


$thread_options = array(
$form->generate_check_box("classicpostbit", 1, $lang->show_classic_postbit, array("checked" => $mybb->input['classicpostbit'])),


$thread_options = array(
$form->generate_check_box("classicpostbit", 1, $lang->show_classic_postbit, array("checked" => $mybb->input['classicpostbit'])),

Zeile 1306Zeile 1319
	);
$form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");


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


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


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


	$other_options = array(
$form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->input['showredirect'])),
$form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->input['showcodebuttons'])),

	$other_options = array(
$form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->input['showredirect'])),
$form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->input['showcodebuttons'])),

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


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


	//

	//

	// SIGNATURE EDITOR
//
$signature_editor = $form->generate_text_area("signature", $mybb->input['signature'], array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'height: 250px; width: 95%'));
$sig_smilies = $lang->off;
if($mybb->settings['sigsmilies'] == 1)

	// SIGNATURE EDITOR
//
$signature_editor = $form->generate_text_area("signature", $mybb->input['signature'], array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'height: 250px; width: 95%'));
$sig_smilies = $lang->off;
if($mybb->settings['sigsmilies'] == 1)

	{

	{

		$sig_smilies = $lang->on;
}
$sig_mycode = $lang->off;

		$sig_smilies = $lang->on;
}
$sig_mycode = $lang->off;

Zeile 1339Zeile 1352
	if($mybb->settings['sightml'] == 1)
{
$sig_html = $lang->on;

	if($mybb->settings['sightml'] == 1)
{
$sig_html = $lang->on;

	}

	}

	$sig_imgcode = $lang->off;
if($mybb->settings['sigimgcode'] == 1)
{

	$sig_imgcode = $lang->off;
if($mybb->settings['sigimgcode'] == 1)
{

Zeile 1371Zeile 1384
		else
{
// There's a limit to the suspension!

		else
{
// There's a limit to the suspension!

			$expired = my_date('relative', $user['suspendsigtime']);
$lang->suspend_expire_info = $lang->sprintf($lang->suspend_expire_info, $expired);

















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

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

$lang->suspend_expire_info = $lang->sprintf($lang->suspend_expire_info, $expired, $color);

		}
$user_suspend_info = '
<tr>

		}
$user_suspend_info = '
<tr>

Zeile 1395Zeile 1424
			if($("#suspend_action").is(\':visible\'))
{
$("#suspend_action").hide();

			if($("#suspend_action").is(\':visible\'))
{
$("#suspend_action").hide();

			}

			}

			else
{
$("#suspend_action").show();

			else
{
$("#suspend_action").show();

Zeile 1410Zeile 1439
			<table cellpadding="4">'.$user_suspend_info.'
<tr>
<td width="30%"><small>'.$lang->expire_length.'</small></td>

			<table cellpadding="4">'.$user_suspend_info.'
<tr>
<td width="30%"><small>'.$lang->expire_length.'</small></td>

					<td>'.$form->generate_text_box('action_time', $mybb->input['action_time'], array('style' => 'width: 2em;')).' '.$form->generate_select_box('action_period', $periods, $mybb->input['action_period']).'</td>

					<td>'.$form->generate_numeric_field('action_time', $mybb->input['action_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$form->generate_select_box('action_period', $periods, $mybb->input['action_period']).'</td>

				</tr>
</table>
</dd>

				</tr>
</table>
</dd>

Zeile 1460Zeile 1489

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 1526Zeile 1555
		$mybb->input['moderateposting'] = 1;
if($user['moderationtime'] != 0)
{

		$mybb->input['moderateposting'] = 1;
if($user['moderationtime'] != 0)
{

			$expired = my_date('relative', $user['moderationtime']);
$existing_info = $lang->sprintf($lang->moderate_length, $expired);

















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

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

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

		}
else
{
$existing_info = $lang->moderated_perm;

		}
else
{
$existing_info = $lang->moderated_perm;

		}

		}

	}


	}


	$modpost_div = '<div id="modpost">'.$existing_info.''.$lang->moderate_for.' '.$form->generate_text_box("modpost_time", $mybb->input['modpost_time'], array('style' => 'width: 2em;')).' '.$modpost_options.'</div>';

	$modpost_div = '<div id="modpost">'.$existing_info.''.$lang->moderate_for.' '.$form->generate_numeric_field("modpost_time", $mybb->input['modpost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$modpost_options.'</div>';

	$lang->moderate_posts_info = $lang->sprintf($lang->moderate_posts_info, $user['username']);

	$lang->moderate_posts_info = $lang->sprintf($lang->moderate_posts_info, $user['username']);

	$form_container->output_row($form->generate_check_box("moderateposting", 1, $lang->moderate_posts, array("id" => "moderateposting", "onclick" => "toggleBox('modpost');", "checked" => $mybb->input['moderateposting'])), $lang->moderate_posts_info, $modpost_div);

	$form_container->output_row($form->generate_check_box("moderateposting", 1, $lang->moderate_posts, array("id" => "moderateposting", "onclick" => "toggleBox('modpost');", "checked" => $mybb->input['moderateposting'])), $lang->moderate_posts_info, $modpost_div);


// Suspend posts
// Generate check box


// Suspend posts
// Generate check box

Zeile 1549Zeile 1594
		$mybb->input['suspendposting'] = 1;

if($user['suspensiontime'] == 0 || $mybb->input['suspost_period'] == "never")

		$mybb->input['suspendposting'] = 1;

if($user['suspensiontime'] == 0 || $mybb->input['suspost_period'] == "never")

		{

		{

			$existing_info = $lang->suspended_perm;
}
else
{

			$existing_info = $lang->suspended_perm;
}
else
{

			$suspost_date = my_date('relative', $user['suspensiontime']);
$existing_info = $lang->sprintf($lang->suspend_length, $suspost_date);

















			$remaining = $user['suspensiontime']-TIME_NOW;
$suspost_date = nice_time($remaining, array('seconds' => false));

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

$existing_info = $lang->sprintf($lang->suspend_length, $suspost_date, $color);

		}
}


		}
}


	$suspost_div = '<div id="suspost">'.$existing_info.''.$lang->suspend_for.' '.$form->generate_text_box("suspost_time", $mybb->input['suspost_time'], array('style' => 'width: 2em;')).' '.$suspost_options.'</div>';

	$suspost_div = '<div id="suspost">'.$existing_info.''.$lang->suspend_for.' '.$form->generate_numeric_field("suspost_time", $mybb->input['suspost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$suspost_options.'</div>';

	$lang->suspend_posts_info = $lang->sprintf($lang->suspend_posts_info, $user['username']);

	$lang->suspend_posts_info = $lang->sprintf($lang->suspend_posts_info, $user['username']);

	$form_container->output_row($form->generate_check_box("suspendposting", 1, $lang->suspend_posts, array("id" => "suspendposting", "onclick" => "toggleBox('suspost');", "checked" => $mybb->input['suspendposting'])), $lang->suspend_posts_info, $suspost_div);


$form_container->end();

	$form_container->output_row($form->generate_check_box("suspendposting", 1, $lang->suspend_posts, array("id" => "suspendposting", "onclick" => "toggleBox('suspost');", "checked" => $mybb->input['suspendposting'])), $lang->suspend_posts_info, $suspost_div);


$form_container->end();

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

Zeile 1670Zeile 1731
		if(!$userhandler->delete_user($user['uid']))
{
flash_message($lang->error_cannot_delete_user, 'error');

		if(!$userhandler->delete_user($user['uid']))
{
flash_message($lang->error_cannot_delete_user, 'error');

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




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

$cache->update_awaitingactivation();


		$plugins->run_hooks("admin_user_users_delete_commit_end");

		$plugins->run_hooks("admin_user_users_delete_commit_end");





		log_admin_action($user['uid'], $user['username']);

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

		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 1706Zeile 1769
	if(!$default_view)
{
$default_view = "0";

	if(!$default_view)
{
$default_view = "0";

	}

	}

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


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


Zeile 1725Zeile 1788
	{
$table = new Table;
$table->construct_cell($lang->error_no_referred_users);

	{
$table = new Table;
$table->construct_cell($lang->error_no_referred_users);

		$table->construct_row();

		$table->construct_row();

		$table->output($lang->show_referrers);

		$table->output($lang->show_referrers);

	}

	}

	else
{
echo $view;

	else
{
echo $view;

	}

	}


$page->output_footer();
}


$page->output_footer();
}

Zeile 1750Zeile 1813
	$plugins->run_hooks("admin_user_users_ipaddresses");

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

	$plugins->run_hooks("admin_user_users_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);


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


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

if(empty($user['lastip']))

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

if(empty($user['lastip']))

	{

	{

		$user['lastip'] = $lang->unknown;
$controls = '';
}

		$user['lastip'] = $lang->unknown;
$controls = '';
}

Zeile 1772Zeile 1835
		$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));
$popup = new PopupMenu("user_last", $lang->options);
$popup->add_item($lang->show_users_regged_with_ip,

		$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));
$popup = new PopupMenu("user_last", $lang->options);
$popup->add_item($lang->show_users_regged_with_ip,

			"index.php?module=user-users&amp;action=search&amp;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']))));

			"index.php?module=user-users&amp;action=search&amp;results=1&amp;conditions=".urlencode(my_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(my_serialize(array("postip" => $user['lastip']))));

		$popup->add_item($lang->info_on_ip, "index.php?module=user-users&amp;action=iplookup&ipaddress={$user['lastip']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$user['lastip']}', null, true); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$user['lastip']}");
$controls = $popup->fetch();
}
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".$user['lastip']);

		$popup->add_item($lang->info_on_ip, "index.php?module=user-users&amp;action=iplookup&ipaddress={$user['lastip']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$user['lastip']}', null, true); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$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;
$controls = '';
}
else

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

	{

	{

		$user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));
$popup = new PopupMenu("user_reg", $lang->options);

		$user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));
$popup = new PopupMenu("user_reg", $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" => $user['regip']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user-users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $user['regip']))));

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

		$popup->add_item($lang->info_on_ip, "index.php?module=user-users&amp;action=iplookup&ipaddress={$user['regip']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$user['regip']}', null, true); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();

		$popup->add_item($lang->info_on_ip, "index.php?module=user-users&amp;action=iplookup&ipaddress={$user['regip']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$user['regip']}', null, true); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();

Zeile 1809Zeile 1872
		++$counter;
$ip['ipaddress'] = my_inet_ntop($db->unescape_binary($ip['ipaddress']));
$popup = new PopupMenu("id_{$counter}", $lang->options);

		++$counter;
$ip['ipaddress'] = my_inet_ntop($db->unescape_binary($ip['ipaddress']));
$popup = new PopupMenu("id_{$counter}", $lang->options);

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

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

		$popup->add_item($lang->info_on_ip, "index.php?module=user-users&amp;action=iplookup&ipaddress={$ip['ipaddress']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$ip['ipaddress']}', null, true); 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, "index.php?module=user-users&amp;action=iplookup&ipaddress={$ip['ipaddress']}", "MyBB.popupWindow('index.php?module=user-users&amp;action=iplookup&ipaddress={$ip['ipaddress']}', null, true); return false;");
$popup->add_item($lang->ban_ip, "index.php?module=config-banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();

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

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





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

$page->output_footer();

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

$page->output_footer();

Zeile 1839Zeile 1902

$destination_user = get_user_by_username($mybb->input['destination_username'], array('fields' => '*'));
if(!$destination_user['uid'])


$destination_user = get_user_by_username($mybb->input['destination_username'], array('fields' => '*'));
if(!$destination_user['uid'])

		{

		{

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


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


Zeile 1999Zeile 2062
			$lists = array(
"buddylist" => $buddies,
"ignorelist" => $ignored

			$lists = array(
"buddylist" => $buddies,
"ignorelist" => $ignored

			);

			);

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

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

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

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





			// Delete the old user
$userhandler->delete_user($source_user['uid']);


			// Delete the old user
$userhandler->delete_user($source_user['uid']);


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

			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);
$updated_count = array(
"postnum" => $num['postnum']

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

			);

			);

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

// Update user thread count

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

// Update user thread count

Zeile 2046Zeile 2109
			}

$plugins->run_hooks("admin_user_users_merge_commit");

			}

$plugins->run_hooks("admin_user_users_merge_commit");

 

$cache->update_awaitingactivation();


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


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

Zeile 2078Zeile 2143
	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

	<script type="text/javascript" src="../jscripts/select2/select2.min.js"></script>

	<script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>

	<script type="text/javascript">
<!--
$("#source_username").select2({

	<script type="text/javascript">
<!--
$("#source_username").select2({

		placeholder: "Search for a user",
minimumInputLength: 3,
maximumSelectionSize: 3,

		placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,


		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

Zeile 2112Zeile 2176
		}
});
$("#destination_username").select2({

		}
});
$("#destination_username").select2({

		placeholder: "Search for a user",
minimumInputLength: 3,
maximumSelectionSize: 3,

		placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,


		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

		multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

Zeile 2160Zeile 2223
		// Build view options from incoming search options
if($mybb->input['vid'])
{

		// Build view options from incoming search options
if($mybb->input['vid'])
{

			$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', 1)."'");

			$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");

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

Zeile 2207Zeile 2270
			$admin_view['sortby'] = $mybb->input['sortby'];
}


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


		if($mybb->get_input('perpage', 1))

		if($mybb->get_input('perpage', MyBB::INPUT_INT))

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

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

Zeile 2223Zeile 2286
		}

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

		}

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

		{

		{

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


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


Zeile 2280Zeile 2343
		"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $sort_directions, $mybb->input['order'], array('id' => 'order')), 'sortby');

		"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $sort_directions, $mybb->input['order'], array('id' => 'order')), 'sortby');

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

	$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $mybb->input['perpage'], array('id' => 'perpage', 'min' => 1)), 'perpage');

	$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('displayas', 'table', $lang->table, array('checked' => ($mybb->input['displayas'] != "card" ? true : false)))."<br />".$form->generate_radio_button('displayas', 'card', $lang->business_card, array('checked' => ($mybb->input['displayas'] == "card" ? true : false))));
$form_container->end();


	$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('displayas', 'table', $lang->table, array('checked' => ($mybb->input['displayas'] != "card" ? true : false)))."<br />".$form->generate_radio_button('displayas', 'card', $lang->business_card, array('checked' => ($mybb->input['displayas'] == "card" ? true : false))));
$form_container->end();


Zeile 2322Zeile 2385
		}
}


		}
}


	// If there isn't anything to select, then output an error













	// Verify incoming POST request
if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=user-user");
}
$sub_tabs['manage_users'] = array(
"title" => $lang->manage_users,
"link" => "./",
"description" => $lang->manage_users_desc
);
$page->add_breadcrumb_item($lang->manage_users);


	if(!is_array($selected))
{

	if(!is_array($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
$inline = true;
$mybb->input['action'] = '';

		// Not selected any users, show error
flash_message($lang->error_inline_no_users_selected, 'error');
admin_redirect("index.php?module=user-users".$vid_url);









	}

	}

	else



switch($mybb->input['inline_action'])

	{

	{

		// Let's continue!
// Verify incoming POST request
if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=user-user");
}
$sub_tabs['manage_users'] = array(
"title" => $lang->manage_users,
"link" => "./",
"description" => $lang->manage_users_desc
);
$page->add_breadcrumb_item($lang->manage_users);

if(!is_array($selected))
{
// Not selected any users, show error
flash_message($lang->error_inline_no_users_selected, 'error');
admin_redirect("index.php?module=user-users".$vid_url);
}

switch($mybb->input['inline_action'])
{
case 'multiactivate':
// Run through the activating users, so that users already registered (but have been selected) aren't affected
if(is_array($selected))


































































































		case 'multiactivate':
// Run through the activating users, so that users already registered (but have been selected) aren't affected
if(is_array($selected))
{
$sql_array = implode(",", $selected);
$query = $db->simple_select("users", "uid, username, email", "usergroup = '5' AND uid IN (".$sql_array.")");
$user_mail_data = array();
while($user = $db->fetch_array($query))
{
$to_update[] = $user['uid'];
$user_mail_data[] = array('username' => $user['username'], 'email' => $user['email']);
}
}

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

$cache->update_awaitingactivation();

// send activation mail
foreach($user_mail_data as $mail_data)
{
$message = $lang->sprintf($lang->email_adminactivateaccount, $mail_data['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
my_mail($mail_data['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
}

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

$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);
}
else
{
// 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
if($mybb->input['no'])
{
admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No'
}

if($mybb->request_method == "post")
{
$sql_array = implode(",", $selected);
$query = $db->simple_select("banned", "*", "uid IN (".$sql_array.")");
$to_be_unbanned = $db->num_rows($query);
while($ban = $db->fetch_array($query))
{
$updated_group = array(
"usergroup" => $ban['oldgroup'],
"additionalgroups" => $ban['oldadditionalgroups'],
"displaygroup" => $ban['olddisplaygroup']
);
$db->update_query("users", $updated_group, "uid = '".$ban['uid']."'");
$db->delete_query("banned", "uid = '".$ban['uid']."'");
}

$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');
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;
case 'multiban':
if($mybb->input['processed'] == 1)
{
// We've posted ban information!
// Build an array of users to ban, =D
$sql_array = implode(",", $selected);
// Build a cache array for this users that have been banned already
$query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))
{
$bannedcache[] = "u_".$user['uid'];
}

// Collect the users
$query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");

if($mybb->input['bantime'] == '---')
{
$lifted = 0;
}
else
{
$lifted = ban_date2timestamp($mybb->input['bantime']);
}

$reason = my_substr($mybb->input['reason'], 0, 255);

$banned_count = 0;
while($user = $db->fetch_array($query))

				{

				{

					$sql_array = implode(",", $selected);
$query = $db->simple_select("users", "uid", "usergroup = '5' AND uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))

					if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))



					{

					{

						$to_update[] = $user['uid'];
































						// We remove ourselves and Super Admins from the mix
continue;
}

if(is_array($bannedcache) && in_array("u_".$user['uid'], $bannedcache))
{
// User already has a ban, update it!
$update_array = array(
"admin" => (int)$mybb->user['uid'],
"dateline" => TIME_NOW,
"bantime" => $db->escape_string($mybb->input['bantime']),
"lifted" => $db->escape_string($lifted),
"reason" => $db->escape_string($reason)
);
$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
}
else
{
// Not currently banned - insert the ban
$insert_array = array(
'uid' => $user['uid'],
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT),
'oldgroup' => $user['usergroup'],
'oldadditionalgroups' => $user['additionalgroups'],
'olddisplaygroup' => $user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->input['bantime']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($reason)
);
$db->insert_query('banned', $insert_array);

					}

					}

				}

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

$cache->update_awaitingactivation();

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

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












					// Moved the user to the 'Banned' Group
$update_array = array(
'usergroup' => 7,
'displaygroup' => 0,
'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = '{$user['uid']}'");

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

$cache->update_banned();
++$banned_count;

				}

				}

				else
{
// Nothing was updated, show an error
flash_message($lang->inline_activated_failed, 'error');
admin_redirect("index.php?module=user-users".$vid_url);



































				$mybb->input['action'] = "inline_banned";
log_admin_action($banned_count, $lifted);
my_unsetcookie("inlinemod_useracp"); // Remove the cookie of selected users as we've finished with them

$lang->users_banned = $lang->sprintf($lang->users_banned, $banned_count);
flash_message($lang->users_banned, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}

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

// Provide the user with a warning of what they're about to do
$table = new Table;
$lang->mass_ban_info = $lang->sprintf($lang->mass_ban_info, count($selected));
$table->construct_cell($lang->mass_ban_info);
$table->construct_row();
$table->output($lang->important);

// If there's any errors, display inline
if($errors)
{
$page->output_inline_error($errors);
}

$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiban');
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_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason');
$ban_times = fetch_ban_times();
foreach($ban_times as $time => $period)
{
if($time != '---')
{
$friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));
$period = "{$period} ({$friendly_time})";

				}

				}

				break;
case 'multilift':
// Get the users that are banned, and check that they have been selected
if($mybb->input['no'])















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

$buttons[] = $form->generate_submit_button($lang->ban_users);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;
case 'multidelete':
if($mybb->input['no'])
{
admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No
}
else
{
if($mybb->input['processed'] == 1)

				{

				{

					admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No'
}













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

// Delete users
$deleted = $userhandler->delete_user($selected);
$to_be_deleted = $deleted['deleted_users']; // Get the correct number of deleted users

// Update forum stats, remove the cookie and redirect the user
my_unsetcookie("inlinemod_useracp");
$mybb->input['action'] = "inline_delete";
log_admin_action($to_be_deleted);

$lang->users_deleted = $lang->sprintf($lang->users_deleted, $to_be_deleted);





				if($mybb->request_method == "post")
{
$sql_array = implode(",", $selected);
$query = $db->simple_select("banned", "*", "uid IN (".$sql_array.")");
$to_be_unbanned = $db->num_rows($query);
while($ban = $db->fetch_array($query))
{
$updated_group = array(
"usergroup" => $ban['oldgroup'],
"additionalgroups" => $ban['oldadditionalgroups'],
"displaygroup" => $ban['olddisplaygroup']
);
$db->update_query("users", $updated_group, "uid = '".$ban['uid']."'");
$db->delete_query("banned", "uid = '".$ban['uid']."'");
}

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

					$cache->update_awaitingactivation();






















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

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






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

					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;
case 'multiban':
if($mybb->input['processed'] == 1)
{
// We've posted ban information!
// Build an array of users to ban, =D
$sql_array = implode(",", $selected);
// Build a cache array for this users that have been banned already
$query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))
{
$bannedcache[] = "u_".$user['uid'];
}

// Collect the users
$query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");

if($mybb->input['bantime'] == '---')
{
$lifted = 0;
}
else
{
$lifted = ban_date2timestamp($mybb->input['bantime']);




				}

$to_be_deleted = count($selected);
$lang->confirm_multidelete = $lang->sprintf($lang->confirm_multidelete, my_number_format($to_be_deleted));
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multidelete&amp;my_post_key={$mybb->post_code}&amp;processed=1", $lang->confirm_multidelete);
}
break;
case 'multiprune':
if($mybb->input['processed'] == 1)
{
if(($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) && $mybb->input['set'])
{
$errors[] = $lang->multi_selected_dates;
}

$day = $mybb->get_input('day', MyBB::INPUT_INT);
$month = $mybb->get_input('month', MyBB::INPUT_INT);
$year = $mybb->get_input('year', MyBB::INPUT_INT);

// Selected a date - check if the date the user entered is valid
if($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year'])
{
// Is the date sort of valid?
if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29))
{
$errors[] = $lang->incorrect_date;
}

// Check the month
$months = get_bdays($year);
if($day > $months[$month-1])
{
$errors[] = $lang->incorrect_date;

					}


					}


					$reason = my_substr($mybb->input['reason'], 0, 255);

$banned_count = 0;
while($user = $db->fetch_array($query))

					// Check the year
if($year != 0 && ($year < (date("Y")-100)) || $year > date("Y"))



					{

					{

						if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
{
// We remove ourselves and Super Admins from the mix
continue;
}

if(is_array($bannedcache) && in_array("u_".$user['uid'], $bannedcache))
{
// User already has a ban, update it!
$update_array = array(
"admin" => (int)$mybb->user['uid'],
"dateline" => TIME_NOW,
"bantime" => $db->escape_string($mybb->input['bantime']),
"lifted" => $db->escape_string($lifted),
"reason" => $db->escape_string($reason)
);
$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
}
else
{
// Not currently banned - insert the ban
$insert_array = array(
'uid' => $user['uid'],
'gid' => (int)$mybb->input['usergroup'],
'oldgroup' => $user['usergroup'],
'oldadditionalgroups' => $user['additionalgroups'],
'olddisplaygroup' => $user['displaygroup'],
'admin' => (int)$mybb->user['uid'],
'dateline' => TIME_NOW,
'bantime' => $db->escape_string($mybb->input['bantime']),
'lifted' => $db->escape_string($lifted),
'reason' => $db->escape_string($reason)
);
$db->insert_query('banned', $insert_array);
}

// Moved the user to the 'Banned' Group
$update_array = array(
'usergroup' => 7,
'displaygroup' => 0,
'additionalgroups' => '',
);
$db->update_query('users', $update_array, "uid = '{$user['uid']}'");

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

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

















































						$cache->update_banned();
++$banned_count;



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

					}

					}

					$mybb->input['action'] = "inline_banned";
log_admin_action($banned_count, $lifted);
my_unsetcookie("inlinemod_useracp"); // Remove the cookie of selected users as we've finished with them

$lang->users_banned = $lang->sprintf($lang->users_banned, $banned_count);
flash_message($lang->users_banned, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}

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

// Provide the user with a warning of what they're about to do
$table = new Table;
$lang->mass_ban_info = $lang->sprintf($lang->mass_ban_info, count($selected));
$table->construct_cell($lang->mass_ban_info);
$table->construct_row();
$table->output($lang->important);

// If there's any errors, display inline
if($errors)
{
$page->output_inline_error($errors);
}

$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiban');
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_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason');
$ban_times = fetch_ban_times();
foreach($ban_times as $time => $period)
{
if($time != '---')

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

switch($mybb->input['set'])
{
case '1':
$threshold = $base_time * 31; // 1 month = 31 days, in the standard terms
break;
case '2':
$threshold = $base_time * 93; // 3 months = 31 days * 3
break;
case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2
break;
case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;
case '5':
$threshold = $base_time * 548; // 18 months = 365 + 183
break;
case '6':
$threshold = $base_time * 730; // 2 years = 365 * 2
break;
}

if(!$threshold)







					{

					{

						$friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));
$period = "{$period} ({$friendly_time})";





						// An option was entered that isn't in the dropdown box
$errors[] = $lang->no_set_option;
}
else
{
$date = TIME_NOW - $threshold;

					}

					}

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

$buttons[] = $form->generate_submit_button($lang->ban_users);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;
case 'multidelete':
if($mybb->input['no'])
{
admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No

 
				}
else
{

				}
else
{

					if($mybb->input['processed'] == 1)









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

if(!$errors)
{
$sql_array = implode(",", $selected);
$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))

					{

					{

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

// Delete users
$deleted = $userhandler->delete_user($selected);
$to_be_deleted = $deleted['deleted_users']; // Get the correct number of deleted users

// Update forum stats, remove the cookie and redirect the user
my_unsetcookie("inlinemod_useracp");
$mybb->input['action'] = "inline_delete";
log_admin_action($to_be_deleted);

$lang->users_deleted = $lang->sprintf($lang->users_deleted, $to_be_deleted);
flash_message($lang->users_deleted, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}

$to_be_deleted = count($selected);
$lang->confirm_multidelete = $lang->sprintf($lang->confirm_multidelete, my_number_format($to_be_deleted));
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multidelete&amp;my_post_key={$mybb->post_code}&amp;processed=1", $lang->confirm_multidelete);
}
break;
case 'multiprune':
if($mybb->input['processed'] == 1)
{
if(($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) && $mybb->input['set'])
{
$errors[] = $lang->multi_selected_dates;
}

$day = (int)$mybb->input['day'];
$month = (int)$mybb->input['month'];
$year = (int)$mybb->input['year'];

// Selected a date - check if the date the user entered is valid
if($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year'])
{
// Is the date sort of valid?
if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29))
{
$errors[] = $lang->incorrect_date;
}

// Check the month
$months = get_bdays($year);
if($day > $months[$month]-1)
{
$errors[] = $lang->incorrect_date;
}

// Check the year
if($year != 0 && ($year < (date("Y")-100)) || $year > date("Y"))
{
$errors[] = $lang->incorrect_date;
}

if(!$errors)
{
// No errors, so let's continue and set the date to delete from
$date = mktime(date('H'), date('i'), date('s'), $month, $day, $year); // Generate a unix time stamp
}
}
elseif($mybb->input['set'] > 0)
{
// Set options
// For this purpose, 1 month = 31 days
$base_time = 24 * 60 * 60;

switch($mybb->input['set'])
{
case '1':
$threshold = $base_time * 31; // 1 month = 31 days, in the standard terms
break;
case '2':
$threshold = $base_time * 93; // 3 months = 31 days * 3
break;
case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2
break;
case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;
case '5':
$threshold = $base_time * 548; // 18 months = 365 + 183
break;
case '6':
$threshold = $base_time * 730; // 2 years = 365 * 2
break;
}

if(!$threshold)
{
// An option was entered that isn't in the dropdown box
$errors[] = $lang->no_set_option;
}
else
{
$date = TIME_NOW - $threshold;
}
}
else
{
$errors[] = $lang->no_prune_option;
}

if(!$errors)
{
$sql_array = implode(",", $selected);
$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");
while($user = $db->fetch_array($query))
{
// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
{
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);
}
}

// No posts were found for the user, return error
if(!is_array($prune_array) || count($prune_array) == 0)
{
flash_message($lang->prune_fail, 'error');
admin_redirect("index.php?module=user-users".$vid_url);
}

// Require the rebuild functions
require_once MYBB_ROOT.'/inc/functions.php';
require_once MYBB_ROOT.'/inc/functions_rebuild.php';

// We've finished deleting user's posts, so let's delete the threads
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("polls", "tid='$tid'");
$db->delete_query("threadsread", "tid='$tid'");
$db->delete_query("threadratings", "tid='$tid'");
}
}

// After deleting threads, rebuild the thread counters for the affected threads
if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)
{
$sql_array = implode(",", $prune_array['thread_update']);
$query = $db->simple_select("threads", "tid", "tid IN (".$sql_array.")", array('order_by' => 'tid', 'order_dir' => 'asc'));
while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);
}
}

// After updating thread counters, update the affected forum counters
if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)
{
$sql_array = implode(",", $prune_array['forum_update']);
$query = $db->simple_select("forums", "fid", "fid IN (".$sql_array.")", array('order_by' => 'fid', 'order_dir' => 'asc'));
while($forum = $db->fetch_array($query))
{
// Because we have a recursive array merge, check to see if there isn't a duplicated forum to update
if($looped_forum == $forum['fid'])
{
continue;
}
$looped_forum = $forum['fid'];
rebuild_forum_counters($forum['fid']);
}

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

// No posts were found for the user, return error
if(!is_array($prune_array) || count($prune_array) == 0)
{
flash_message($lang->prune_fail, 'error');
admin_redirect("index.php?module=user-users".$vid_url);
}

// Require the rebuild functions
require_once MYBB_ROOT.'/inc/functions.php';
require_once MYBB_ROOT.'/inc/functions_rebuild.php';

// We've finished deleting user's posts, so let's delete the threads
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("polls", "tid='$tid'");
$db->delete_query("threadsread", "tid='$tid'");
$db->delete_query("threadratings", "tid='$tid'");















































































































































						}

						}


//log_admin_action();
my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie
flash_message($lang->prune_complete, 'success');
admin_redirect("index.php?module=user-users".$vid_url);

 
					}

					}

				}

$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));
$table->construct_cell($lang->mass_prune_info);
$table->construct_row();
$table->output($lang->important);

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

// Display the prune options
$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);

// Generate a list of days (1 - 31)
$day_options = array();
$day_options[] = "&nbsp;";
for($i = 1; $i <= 31; ++$i)
{
$day_options[] = $i;
}

// Generate a list of months (1 - 12)
$month_options = array();
$month_options[] = "&nbsp;";
for($i = 1; $i <= 12; ++$i)
{
$string = "month_{$i}";
$month_options[] = $lang->$string;
}
$date_box = $form->generate_select_box('day', $day_options, $mybb->input['day']);
$month_box = $form->generate_select_box('month', $month_options, $mybb->input['month']);
$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');

// Generate the set date box
$set_options = array();
$set_options[] = $lang->set_an_option;
for($i = 1; $i <= 6; ++$i)
{
$string = "option_{$i}";
$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->end();

 




				$buttons[] = $form->generate_submit_button($lang->prune_posts);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;
case 'multiusergroup':
if($mybb->input['processed'] == 1)
{
// Determine additional usergroups
if(is_array($mybb->input['additionalgroups']))

					// After deleting threads, rebuild the thread counters for the affected threads
if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)









					{

					{

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



						$sql_array = implode(",", $prune_array['thread_update']);
$query = $db->simple_select("threads", "tid", "tid IN (".$sql_array.")", array('order_by' => 'tid', 'order_dir' => 'asc'));
while($thread = $db->fetch_array($query))

						{

						{

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













							rebuild_thread_counters($thread['tid']);
}
}

// After updating thread counters, update the affected forum counters
if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)
{
$sql_array = implode(",", $prune_array['forum_update']);
$query = $db->simple_select("forums", "fid", "fid IN (".$sql_array.")", array('order_by' => 'fid', 'order_dir' => 'asc'));
while($forum = $db->fetch_array($query))
{
// Because we have a recursive array merge, check to see if there isn't a duplicated forum to update
if($looped_forum == $forum['fid'])

							{

							{

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

								continue;

							}

							}

						}


































































							$looped_forum = $forum['fid'];
rebuild_forum_counters($forum['fid']);
}
}

//log_admin_action();
my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie
flash_message($lang->prune_complete, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}
}

$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));
$table->construct_cell($lang->mass_prune_info);
$table->construct_row();
$table->output($lang->important);

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

// Display the prune options
$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);

// Generate a list of days (1 - 31)
$day_options = array();
$day_options[] = "&nbsp;";
for($i = 1; $i <= 31; ++$i)
{
$day_options[] = $i;
}

// Generate a list of months (1 - 12)
$month_options = array();
$month_options[] = "&nbsp;";
for($i = 1; $i <= 12; ++$i)
{
$string = "month_{$i}";
$month_options[] = $lang->$string;
}
$date_box = $form->generate_select_box('day', $day_options, $mybb->input['day']);
$month_box = $form->generate_select_box('month', $month_options, $mybb->input['month']);
$year_box = $form->generate_numeric_field('year', $mybb->input['year'], array('id' => 'year', 'style' => 'width: 50px;', 'min' => 0));

$prune_select = $date_box.$month_box.$year_box;
$form_container->output_row($lang->manual_date, "", $prune_select, 'date');

// Generate the set date box
$set_options = array();
$set_options[] = $lang->set_an_option;
for($i = 1; $i <= 6; ++$i)
{
$string = "option_{$i}";
$set_options[] = $lang->$string;
}





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

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









					// Create an update array
$update_array = array(
"usergroup" => (int)$mybb->input['usergroup'],
"additionalgroups" => $additionalgroups,
"displaygroup" => (int)$mybb->input['displaygroup']
);

// Do the usergroup update for all those selected
// If the a selected user is a super admin, don't update that user
foreach($selected as $user)



			$buttons[] = $form->generate_submit_button($lang->prune_posts);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;
case 'multiusergroup':
if($mybb->input['processed'] == 1)
{
// Determine additional usergroups
if(is_array($mybb->input['additionalgroups']))
{
foreach($mybb->input['additionalgroups'] as $key => $gid)

					{

					{

						if(!is_super_admin($user))

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

						{

						{

							$users_to_update[] = $user;

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

						}

						}

					}

$to_update_count = count($users_to_update);
if($to_update_count > 0 && is_array($users_to_update))
{
// Update the users in the database
$sql = implode(",", $users_to_update);
$db->update_query("users", $update_array, "uid IN (".$sql.")");

// Redirect the admin...
$mybb->input['action'] = "inline_usergroup";
log_admin_action($to_update_count);
my_unsetcookie("inlinemod_useracp");
flash_message($lang->success_mass_usergroups, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}
else





					}

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

// Create an update array
$update_array = array(
"usergroup" => $mybb->get_input('usergroup', MyBB::INPUT_INT),
"additionalgroups" => $additionalgroups,
"displaygroup" => $mybb->get_input('displaygroup', MyBB::INPUT_INT)
);

// Do the usergroup update for all those selected
// If the a selected user is a super admin, don't update that user
foreach($selected as $user)
{
if(!is_super_admin($user))

					{

					{

						// They tried to edit super admins! Uh-oh!
$errors[] = $lang->no_usergroup_changed;

						$users_to_update[] = $user;


					}

					}

				}

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

// Display a table warning
$table = new Table;
$lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected));
$table->construct_cell($lang->usergroup_info);
$table->construct_row();
$table->output($lang->important);

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

// Display the usergroup options
$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiusergroup');
echo $form->generate_hidden_field('processed', '1');

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

				}




























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

				$to_update_count = count($users_to_update);
if($to_update_count > 0 && is_array($users_to_update))




				{

				{

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

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








					// Update the users in the database
$sql = implode(",", $users_to_update);
$db->update_query("users", $update_array, "uid IN (".$sql.")");

// Redirect the admin...
$mybb->input['action'] = "inline_usergroup";
log_admin_action($to_update_count);
my_unsetcookie("inlinemod_useracp");
flash_message($lang->success_mass_usergroups, 'success');
admin_redirect("index.php?module=user-users".$vid_url);
}
else

				{

				{

					$mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']);


					// They tried to edit super admins! Uh-oh!
$errors[] = $lang->no_usergroup_changed;

				}

				}

 
			}

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

// Display a table warning
$table = new Table;
$lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected));
$table->construct_cell($lang->usergroup_info);
$table->construct_row();
$table->output($lang->important);

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





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



			// Display the usergroup options
$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiusergroup');
echo $form->generate_hidden_field('processed', '1');





				$form_container->end();

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





				$buttons[] = $form->generate_submit_button($lang->alter_usergroups);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;
}





















			// Usergroups
$display_group_options[0] = $lang->use_primary_user_group;
$options = array();
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{
$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']);
}

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

$buttons[] = $form->generate_submit_button($lang->alter_usergroups);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
break;

	}
}


	}
}


Zeile 2966Zeile 3022
		// Showing a specific view
if(isset($mybb->input['vid']))
{

		// Showing a specific view
if(isset($mybb->input['vid']))
{

			$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', 1)."'");

			$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");

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

Zeile 3038Zeile 3094
	$page->output_footer();
}


	$page->output_footer();
}


 
/**
* @param array $view
*
* @return string
*/

function build_users_view($view)
{
global $mybb, $db, $cache, $lang, $user_view_fields, $page;

function build_users_view($view)
{
global $mybb, $db, $cache, $lang, $user_view_fields, $page;

Zeile 3288Zeile 3349
				}
else
{

				}
else
{

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

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

				}
}
}

				}
}
}

Zeile 3380Zeile 3441
		}
else
{

		}
else
{

			$mybb->input['page'] = $mybb->get_input('page', 1);

			$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);

		}

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

		}

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

Zeile 3440Zeile 3501
		{
$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 3508Zeile 3569

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


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

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


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

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

Zeile 3533Zeile 3599
				$user['avatar'] = "../".$mybb->settings['useravatar'];
}
$user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";

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

 

// Convert IP's to readable
$user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));
$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));


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


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

Zeile 3561Zeile 3631
	$switch_url = $view['url'];
if($mybb->input['page'] > 0)
{

	$switch_url = $view['url'];
if($mybb->input['page'] > 0)
{

		$switch_url .= "&amp;page=".$mybb->get_input('page', 1);

		$switch_url .= "&amp;page=".$mybb->get_input('page', MyBB::INPUT_INT);

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

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

Zeile 3589Zeile 3659
	$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='))

	{

	{

		$search_action = substr($search_action, 0, $view_upos);
}
$search_action = str_replace("&amp;", "&", $search_action);

		$search_action = substr($search_action, 0, $view_upos);
}
$search_action = str_replace("&amp;", "&", $search_action);

Zeile 3629Zeile 3699
		{
var searched_focus = $(this);
if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')

		{
var searched_focus = $(this);
if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')

			{

			{

				searched_focus.removeClass(\"search_default\");
searched_focus.val(\"\");
}

				searched_focus.removeClass(\"search_default\");
searched_focus.val(\"\");
}

Zeile 3669Zeile 3739
	else
{
$checkbox = "<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this)\" /> ";

	else
{
$checkbox = "<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this)\" /> ";

	}

	}

	$built_view .= $table->construct_html("{$switch_view}<div>{$checkbox}{$lang->users}{$view_title}</div>", 1, "", $view['table_id']);
if(isset($pagination))
{
$built_view .= $pagination;

	$built_view .= $table->construct_html("{$switch_view}<div>{$checkbox}{$lang->users}{$view_title}</div>", 1, "", $view['table_id']);
if(isset($pagination))
{
$built_view .= $pagination;

	}


	}


	$built_view .= '
<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1800"></script>
<form action="index.php?module=user-users" method="post">

	$built_view .= '
<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1800"></script>
<form action="index.php?module=user-users" method="post">

Zeile 3705Zeile 3775

return $built_view;
}


return $built_view;
}











/**
* @param array $user
* @param array $view
* @param int $i
*
* @return string
*/

function build_user_view_card($user, $view, &$i)
{
global $user_view_fields;

function build_user_view_card($user, $view, &$i)
{
global $user_view_fields;

Zeile 3717Zeile 3794
	}

// Loop through fields user wants to show

	}

// Loop through fields user wants to show

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

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


$view_field = $user_view_fields[$field];



$view_field = $user_view_fields[$field];


Zeile 3786Zeile 3863

}



}


 
/**
* @param array $user
* @param array $view
* @param DefaultTable $table
*/

function build_user_view_table($user, $view, &$table)
{
global $user_view_fields;

function build_user_view_table($user, $view, &$table)
{
global $user_view_fields;

Zeile 3823Zeile 3905
	$table->construct_row();
}


	$table->construct_row();
}


 
/**
* @param array $user
* @param int $max_width
* @param int $max_height
*
* @return array
*/

function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{
$scaled_dimensions = array(
"width" => $max_width,
"height" => $max_height,

function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{
$scaled_dimensions = array(
"width" => $max_width,
"height" => $max_height,

	);

	);


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


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

		{

		{

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

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

	}


	}


	return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']);
}


	return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']);
}


 
/**
* @param array $fields
* @param array $values
* @param DefaultFormContainer $form_container
* @param DefaultForm $form
* @param bool $search
*/

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;

Zeile 3853Zeile 3949
	}
foreach($fields as $profile_field)
{

	}
foreach($fields as $profile_field)
{

		$profile_field['type'] = htmlspecialchars_uni($profile_field['type']);


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

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

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

Zeile 3864Zeile 3961
				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
{
$user_options = $values[$field_name];

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

Zeile 3873Zeile 3970
				$selected_options = array();
foreach($user_options as $val)
{

				$selected_options = array();
foreach($user_options as $val)
{

					$selected_options[$val] = $val;








					$selected_options[$val] = htmlspecialchars_uni($val);
}

$select_options = explode("\n", $options);
$options = array();
if($search == true)
{
$select_options[''] = $lang->na;

				}


				}


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

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

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








					$options[$val] = $val;
}
if(!$profile_field['length'])
{
$profile_field['length'] = 3;

					$options[$val] = $val;
}
if(!$profile_field['length'])
{
$profile_field['length'] = 3;

				}

				}

				$code = $form->generate_select_box("profile_fields[{$field_name}][]", $options, $selected_options, array('id' => "profile_field_{$field_name}", 'multiple' => true, 'size' => $profile_field['length']));
break;
case "select":

				$code = $form->generate_select_box("profile_fields[{$field_name}][]", $options, $selected_options, array('id' => "profile_field_{$field_name}", 'multiple' => true, 'size' => $profile_field['length']));
break;
case "select":

Zeile 3904Zeile 4001
				$options = array();
foreach($select_options as $val)
{

				$options = array();
foreach($select_options as $val)
{

					$val = trim($val);

					$val = htmlspecialchars_uni(trim($val));

					$options[$val] = $val;

					$options[$val] = $val;

				}

				}

				if(!$profile_field['length'])

				if(!$profile_field['length'])

				{

				{

					$profile_field['length'] = 1;

					$profile_field['length'] = 1;

				}
if($search == true)
{
$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']));

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

				}
else
{

				}
else
{

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

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

				}
break;
case "radio":

				}
break;
case "radio":

Zeile 3931Zeile 4028
				foreach($radio_options as $val)
{
$val = trim($val);

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

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

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

				}
break;
case "checkbox":
if(!is_array($values[$field_name]))

				}
break;
case "checkbox":
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)
{
$selected_options[$val] = $val;

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

Zeile 3957Zeile 4054
				foreach($select_options as $val)
{
$val = trim($val);

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

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

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

				}
break;
case "textarea":

				}
break;
case "textarea":

Zeile 3985Zeile 4082
	}
}


	}
}


 
/**
* @param array $input
* @param DefaultForm $form
*/

function user_search_conditions($input=array(), &$form)
{
global $mybb, $db, $lang;

function user_search_conditions($input=array(), &$form)
{
global $mybb, $db, $lang;

Zeile 4017Zeile 4118
	$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 4050Zeile 4151

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


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





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

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

		}

		}

		else
{
$profile_fields['optional'][] = $profile_field;

		else
{
$profile_fields['optional'][] = $profile_field;

Zeile 4072Zeile 4173
	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

	// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">

<script type="text/javascript" src="../jscripts/select2/select2.min.js"></script>

<script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>

<script type="text/javascript">
<!--
$("#username").select2({

<script type="text/javascript">
<!--
$("#username").select2({

	placeholder: "Search for a user",
minimumInputLength: 3,
maximumSelectionSize: 3,

	placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,


	multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

	multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",

Zeile 4108Zeile 4208
// -->
</script>';
}

// -->
</script>';
}


?>