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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 254Zeile 254
	my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);

// Log admin action

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

// Log admin action

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

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


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


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

Zeile 359Zeile 359
			$plugins->run_hooks("admin_user_users_add_commit");

// Log admin action

			$plugins->run_hooks("admin_user_users_add_commit");

// Log admin action

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

			log_admin_action($user_info['uid'], htmlspecialchars_uni($user_info['username']));


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


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

Zeile 393Zeile 393
	}

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

	}

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

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

	$form_container->output_row($lang->username." <em>*</em>", "", $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'username');

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

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

Zeile 421Zeile 421
	$form->end();
$page->output_footer();
}

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





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

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

Zeile 437Zeile 437

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


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

 
		$plugins->run_hooks("admin_user_users_edit_start");

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

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

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

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

				}

				}

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

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

Zeile 621Zeile 622
						"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW,
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"

						"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW,
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"

					);
}
}

					);
}
}

			// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{

			// Are we setting a new avatar from a URL?
else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{

				if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false)
{
// Gravatar
$email = md5(strtolower(trim($mybb->input['avatar_url'])));

$s = '';
if(!$mybb->settings['maxavatardims'])
{
$mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits
}

// Because Gravatars are square, hijack the width
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;

$extra_user_updates = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

				if(!$mybb->settings['allowremoteavatars'])
{
$errors = array($lang->error_remote_avatar_not_allowed);




















				}
else
{

				}
else
{

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

// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatar_url']);
if(!$file)
{
$avatar_error = $lang->error_invalidavatarurl;















					if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false)
{
// Gravatar
$email = md5(strtolower(trim($mybb->input['avatar_url'])));

$s = '';
if(!$mybb->settings['maxavatardims'])
{
$mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits
}

// Because Gravatars are square, hijack the width
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;

$extra_user_updates = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);

					}
else
{

					}
else
{

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




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

// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatar_url']);
if(!$file)

						{
$avatar_error = $lang->error_invalidavatarurl;
}
else
{

						{
$avatar_error = $lang->error_invalidavatarurl;
}
else
{

							fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);
@unlink($tmp_name);
echo $type;
if(!$type)

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




							{
$avatar_error = $lang->error_invalidavatarurl;

							{
$avatar_error = $lang->error_invalidavatarurl;

							}
}
}

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

							}
else









							{

							{

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








								fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);
@unlink($tmp_name);
echo $type;
if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;
}

							}
}

							}
}

					}

 




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

						if(empty($avatar_error))



						{

						{

							$avatar_dimensions = (int)$width."|".(int)$height;



























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

if(empty($avatar_error))
{
if($width > 0 && $height > 0)
{
$avatar_dimensions = (int)$width."|".(int)$height;
}
$extra_user_updates = array(
"avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
remove_avatars($user['uid']);
}
else
{
$errors = array($avatar_error);

						}

						}

						$extra_user_updates = array(
"avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
remove_avatars($user['uid']);
}
else
{
$errors = array($avatar_error);

 
					}
}
}

					}
}
}

Zeile 724Zeile 732
					"time" => "action_time", // The time we've entered
"update_field" => "suspendsignature", // The field in the database to update if true
"update_length" => "suspendsigtime" // The length of suspension field in the database

					"time" => "action_time", // The time we've entered
"update_field" => "suspendsignature", // The field in the database to update if true
"update_length" => "suspendsigtime" // The length of suspension field in the database

				),

				),

				2 => array(
"action" => "moderateposting",
"period" => "modpost_period",

				2 => array(
"action" => "moderateposting",
"period" => "modpost_period",

Zeile 745Zeile 753
			foreach($moderator_options as $option)
{
if(!$mybb->input[$option['action']])

			foreach($moderator_options as $option)
{
if(!$mybb->input[$option['action']])

				{

				{

					if($user[$option['update_field']] == 1)
{
// We're revoking the suspension
$extra_user_updates[$option['update_field']] = 0;
$extra_user_updates[$option['update_length']] = 0;

					if($user[$option['update_field']] == 1)
{
// We're revoking the suspension
$extra_user_updates[$option['update_field']] = 0;
$extra_user_updates[$option['update_length']] = 0;

					}


					}


					// Skip this option if we haven't selected it
continue;
}

					// Skip this option if we haven't selected it
continue;
}

Zeile 781Zeile 789
							elseif($suspend_length && $suspend_length != "-1")
{
// Temporary ban on action

							elseif($suspend_length && $suspend_length != "-1")
{
// Temporary ban on action

								$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;

								$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length;

							}
}
elseif(!$user[$option['update_field']])

							}
}
elseif(!$user[$option['update_field']])

Zeile 802Zeile 810
			}

if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

			}

if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])

			{

			{

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

if(isset($away_in_past))
{
$errors[] = $lang->error_acp_return_date_past;

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

if(isset($away_in_past))
{
$errors[] = $lang->error_acp_return_date_past;

			}

			}


if(!$errors)
{


if(!$errors)
{

Zeile 836Zeile 844
				}

// Log admin action

				}

// Log admin action

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

				log_admin_action($user['uid'], htmlspecialchars_uni($mybb->input['username']));


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


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

			}


			}
$plugins->run_hooks("admin_user_users_edit_end");

		}
}

		}
}





	if(!$errors)
{
$user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
$mybb->input = array_merge($mybb->input, $user);

	if(!$errors)
{
$user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
$mybb->input = array_merge($mybb->input, $user);





		$options = array(
'bday1', 'bday2', 'bday3',
'new_password', 'confirm_new_password',
'action_time', 'action_period',
'modpost_period', 'moderateposting', 'modpost_time', 'suspost_period', 'suspost_time'
);

		$options = array(
'bday1', 'bday2', 'bday3',
'new_password', 'confirm_new_password',
'action_time', 'action_period',
'modpost_period', 'moderateposting', 'modpost_time', 'suspost_period', 'suspost_time'
);





		foreach($options as $option)
{
if(!isset($input_user[$option]))
{
$mybb->input[$option] = '';
}

		foreach($options as $option)
{
if(!isset($input_user[$option]))
{
$mybb->input[$option] = '';
}

		}

		}


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


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

Zeile 874Zeile 883
		$mybb->input['bday'][0] = $mybb->input['bday1'];
$mybb->input['bday'][1] = $mybb->input['bday2'];
$mybb->input['bday'][2] = $mybb->get_input('bday3', MyBB::INPUT_INT);

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

	}
else
{

	}
else
{

		$mybb->input['bday'] = array(0, 0, '');

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

		$mybb->input['bday'] = array(0, 0, '');

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

		}
}

		}
}


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

Zeile 898Zeile 907
		if($user['returndate'])
{
list($mybb->input['away_day'], $mybb->input['away_month'], $mybb->input['away_year']) = explode('-', $user['returndate']);

		if($user['returndate'])
{
list($mybb->input['away_day'], $mybb->input['away_month'], $mybb->input['away_year']) = explode('-', $user['returndate']);

		}
}

// Fetch custom profile fields

		}
}

// Fetch custom profile fields

	$query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));

$profile_fields = array();

	$query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));

$profile_fields = array();

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

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

		}
else
{

		}
else
{

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

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

Zeile 923Zeile 932

<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?ver=1805"></script>


<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?ver=1805"></script>

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

	<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1808"></script>

	<script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>
EOF;
$page->output_header($lang->edit_user);

	<script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>
EOF;
$page->output_header($lang->edit_user);

Zeile 970Zeile 979

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


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

	if($user['avatar'])

	if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))

	{
if($user['avatardimensions'])

	{
if($user['avatardimensions'])

		{

		{

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

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

		}
else
{

		}
else
{

			$scaled_dimensions = array(
"width" => 120,
"height" => 120
);

			$scaled_dimensions = array(
"width" => 120,
"height" => 120
);

		}
if(my_substr($user['avatar'], 0, 7) !== 'http://' && my_substr($user['avatar'], 0, 8) !== 'https://')
{

		}
if(!my_validate_url($user['avatar']))
{

			$user['avatar'] = "../{$user['avatar']}\n";
}
}
else
{

			$user['avatar'] = "../{$user['avatar']}\n";
}
}
else
{

		$user['avatar'] = "../".$mybb->settings['useravatar'];








		if(my_validate_url($mybb->settings['useravatar']))
{
$user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}
else
{
$user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}

		$scaled_dimensions = array(
"width" => 120,
"height" => 120

		$scaled_dimensions = array(
"width" => 120,
"height" => 120

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

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

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

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

	}
else
{

	}
else
{

		$timezone = $user['timezone'];

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

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

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

Zeile 1098Zeile 1114
	$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".my_inet_ntop($db->unescape_binary($user['lastip'])));
$table->construct_row();


	$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".my_inet_ntop($db->unescape_binary($user['lastip'])));
$table->construct_row();


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



	$username = htmlspecialchars_uni($user['username']);
$table->output("{$lang->user_overview}: {$username}");
$plugins->run_hooks("admin_user_users_edit_overview");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1106Zeile 1124
	//
echo "<div id=\"tab_profile\">\n";


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


	$form_container = new FormContainer($lang->required_profile_info.": {$user['username']}");

	$form_container = new FormContainer($lang->required_profile_info.": ".htmlspecialchars_uni($user['username']));

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

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

Zeile 1141Zeile 1159

$form_container->end();



$form_container->end();


	$form_container = new FormContainer($lang->optional_profile_info.": {$user['username']}");

	$form_container = new FormContainer($lang->optional_profile_info.': '.htmlspecialchars_uni($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_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');

	$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_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');

Zeile 1187Zeile 1205

if($mybb->settings['allowaway'] != 0)
{


if($mybb->settings['allowaway'] != 0)
{

		$form_container = new FormContainer($lang->away_information.": {$user['username']}");

		$form_container = new FormContainer($lang->away_information.': '.htmlspecialchars_uni($user['username']));

		$awaycheck = array(false, true);
if($mybb->input['away'] == 1)
{

		$awaycheck = array(false, true);
if($mybb->input['away'] == 1)
{

Zeile 1206Zeile 1224
		$form_container->end();
}


		$form_container->end();
}


 
	$plugins->run_hooks("admin_user_users_edit_profile");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1215Zeile 1234
	// Plugin hook note - we should add hooks in above each output_row for the below so users can add their own options to each group :>

echo "<div id=\"tab_settings\">\n";

	// Plugin hook note - we should add hooks in above each output_row for the below so users can add their own options to each group :>

echo "<div id=\"tab_settings\">\n";

	$form_container = new FormContainer($lang->account_settings.": {$user['username']}");

	$form_container = new FormContainer($lang->account_settings.': '.htmlspecialchars_uni($user['username']));

	$login_options = array(
$form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])),
);

	$login_options = array(
$form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])),
);

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

$form_container->end();

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

$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_settings");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1359Zeile 1379
		$sig_imgcode = $lang->on;
}
echo "<div id=\"tab_signature\">\n";

		$sig_imgcode = $lang->on;
}
echo "<div id=\"tab_signature\">\n";

	$form_container = new FormContainer("{$lang->signature}: {$user['username']}");

	$form_container = new FormContainer($lang->signature.': '.htmlspecialchars_uni($user['username']));

	$form_container->output_row($lang->signature, $lang->sprintf($lang->signature_desc, $sig_mycode, $sig_smilies, $sig_imgcode, $sig_html), $signature_editor, 'signature');

$periods = array(

	$form_container->output_row($lang->signature, $lang->sprintf($lang->signature_desc, $sig_mycode, $sig_smilies, $sig_imgcode, $sig_html), $signature_editor, 'signature');

$periods = array(

Zeile 1465Zeile 1485
	$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));

$form_container->end();

	$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));

$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_signatur");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1481Zeile 1502
	{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>";
}

	{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>";
}

	elseif($user['avatartype'] == "remote" || my_strpos(my_strtolower($user['avatar']), "http://") !== false)

	elseif($user['avatartype'] == "remote" || my_validate_url($user['avatar']))

	{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>";
$avatar_url = $user['avatar'];

	{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>";
$avatar_url = $user['avatar'];

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


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


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

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


// Custom avatar
if($mybb->settings['avatarresizing'] == "auto")


// Custom avatar
if($mybb->settings['avatarresizing'] == "auto")

Zeile 1525Zeile 1546
	}
$form_container = new FormContainer($lang->specify_custom_avatar);
$form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');

	}
$form_container = new FormContainer($lang->specify_custom_avatar);
$form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');

	$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');




	if($mybb->settings['allowremoteavatars'])
{
$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');
}

	$form_container->end();

	$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_avatar");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1541Zeile 1566
	);

echo "<div id=\"tab_modoptions\">\n";

	);

echo "<div id=\"tab_modoptions\">\n";

	$form_container = new FormContainer($lang->mod_options.": {$user['username']}");

	$form_container = new FormContainer($lang->mod_options.': '.htmlspecialchars_uni($user['username']));

	$form_container->output_row($lang->user_notes, '', $form->generate_text_area('usernotes', $mybb->input['usernotes'], array('id' => 'usernotes')), 'usernotes');

// Mod posts

	$form_container->output_row($lang->user_notes, '', $form->generate_text_area('usernotes', $mybb->input['usernotes'], array('id' => 'usernotes')), 'usernotes');

// Mod posts

Zeile 1581Zeile 1606
	}

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

	}

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

// Suspend posts

	$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

Zeile 1621Zeile 1646
	}

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

	}

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

 
	$plugins->run_hooks("admin_user_users_edit_moderator_options");

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

Zeile 1738Zeile 1764

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

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


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


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

Zeile 1818Zeile 1844
	$user = $db->fetch_array($query);

// Log admin action

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

// Log admin action

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

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


$table = new Table;



$table = new Table;


Zeile 1883Zeile 1909
		$table->construct_row();
}


		$table->construct_row();
}


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

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


$page->output_footer();
}


$page->output_footer();
}

Zeile 1944Zeile 1970
			$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reportedcontent", $uid_update, "uid='{$source_user['uid']}'");

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

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

 
			$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'");
$db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");

			$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'");
$db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");

 

// Thread ratings
merge_thread_ratings($source_user['uid'], $destination_user['uid']);


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


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

Zeile 1972Zeile 2000
				{
// Multiple reputation is disallowed, and this isn't a post, so let's remove this comment
$to_remove[] = $rep['rid'];

				{
// Multiple reputation is disallowed, and this isn't a post, so let's remove this comment
$to_remove[] = $rep['rid'];

				}

				}


// Remove comments or posts liked by "me"
if($last_result['uid'] == $destination_user['uid'] || $rep['uid'] == $destination_user['uid'])


// Remove comments or posts liked by "me"
if($last_result['uid'] == $destination_user['uid'] || $rep['uid'] == $destination_user['uid'])

Zeile 1983Zeile 2011
						continue;
}
}

						continue;
}
}





				$last_result = array(
"rid" => $rep['rid'],
"uid" => $rep['uid']

				$last_result = array(
"rid" => $rep['rid'],
"uid" => $rep['uid']

Zeile 1995Zeile 2023
			{
$imp = implode(",", $to_remove);
$db->delete_query("reputation", "rid IN (".$imp.")");

			{
$imp = implode(",", $to_remove);
$db->delete_query("reputation", "rid IN (".$imp.")");

			}

			}


// Calculate the new reputation for this user...
$query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'");


// Calculate the new reputation for this user...
$query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'");

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

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

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

 

// Get a list of forums where post count doesn't apply
$fids = array();


// Get a list of forums where post count doesn't apply
$fids = array();

Zeile 2109Zeile 2130
			}

$plugins->run_hooks("admin_user_users_merge_commit");

			}

$plugins->run_hooks("admin_user_users_merge_commit");

 

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


$cache->update_awaitingactivation();

// Log admin action


$cache->update_awaitingactivation();

// Log admin action

			log_admin_action($source_user['uid'], $source_user['username'], $destination_user['uid'], $destination_user['username']);

			log_admin_action($source_user['uid'], htmlspecialchars_uni($source_user['username']), $destination_user['uid'], htmlspecialchars_uni($destination_user['username']));


// Redirect!


// Redirect!

			flash_message("<strong>{$source_user['username']}</strong> {$lang->success_merged} {$destination_user['username']}", "success");



			$username = htmlspecialchars_uni($source_user['username']);
$destination_username = htmlspecialchars_uni($destination_user['username']);
flash_message("<strong>{$username}</strong> {$lang->success_merged} {$destination_username}", "success");

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

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

Zeile 2273Zeile 2303
		if($mybb->get_input('perpage', MyBB::INPUT_INT))
{
$admin_view['perpage'] = $mybb->input['perpage'];

		if($mybb->get_input('perpage', MyBB::INPUT_INT))
{
$admin_view['perpage'] = $mybb->input['perpage'];

		}


		}


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

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

Zeile 2286Zeile 2316
		}

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 2309Zeile 2339
				flash_message($lang->error_no_users_found, 'error');
admin_redirect("index.php");
exit;

				flash_message($lang->error_no_users_found, 'error');
admin_redirect("index.php");
exit;

			}

			}

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

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

Zeile 2321Zeile 2351
	$page->output_header($lang->find_users);

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

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

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


// If we have any error messages, show them


// If we have any error messages, show them

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

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

Zeile 2618Zeile 2648
			{
if($time != '---')
{

			{
if($time != '---')
{

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

					$friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time));

					$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

					$period = "{$period} ({$friendly_time})";
}
$length_list[$time] = $period;

Zeile 3102Zeile 3132
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;

 

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


$view_title = '';
if($view['title'])


$view_title = '';
if($view['title'])

Zeile 3120Zeile 3155
	if(!isset($view['url']))
{
$view['url'] = "index.php?module=user-users";

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

	}

	}

	if(!is_array($view['conditions']))

	if(!is_array($view['conditions']))

	{

	{

		$view['conditions'] = my_unserialize($view['conditions']);
}
if(!is_array($view['fields']))

		$view['conditions'] = my_unserialize($view['conditions']);
}
if(!is_array($view['fields']))

	{

	{

		$view['fields'] = my_unserialize($view['fields']);

		$view['fields'] = my_unserialize($view['fields']);

	}

	}

	if(!is_array($view['custom_profile_fields']))
{
$view['custom_profile_fields'] = my_unserialize($view['custom_profile_fields']);

	if(!is_array($view['custom_profile_fields']))
{
$view['custom_profile_fields'] = my_unserialize($view['custom_profile_fields']);

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

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

	{
$view['conditions']['username'] = $mybb->input['username'];

	{
$view['conditions']['username'] = $mybb->input['username'];

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

	}
if($view['vid'])
{

	}
if($view['vid'])
{

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

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

	}

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

 
	}

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

	}

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

Zeile 3500Zeile 3531
		while($user = $db->fetch_array($query))
{
$comma = $groups_list = '';

		while($user = $db->fetch_array($query))
{
$comma = $groups_list = '';

 
			$user['username'] = htmlspecialchars_uni($user['username']);

			$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'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']);
if($user['additionalgroups'])

			$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'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']);
if($user['additionalgroups'])

Zeile 3554Zeile 3586
			$popup->add_item($lang->delete_user, "index.php?module=user-users&amp;action=delete&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->user_deletion_confirmation}')");
$popup->add_item($lang->show_referred_users, "index.php?module=user-users&amp;action=referrers&amp;uid={$user['uid']}");
$popup->add_item($lang->show_ip_addresses, "index.php?module=user-users&amp;action=ipaddresses&amp;uid={$user['uid']}");

			$popup->add_item($lang->delete_user, "index.php?module=user-users&amp;action=delete&amp;uid={$user['uid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->user_deletion_confirmation}')");
$popup->add_item($lang->show_referred_users, "index.php?module=user-users&amp;action=referrers&amp;uid={$user['uid']}");
$popup->add_item($lang->show_ip_addresses, "index.php?module=user-users&amp;action=ipaddresses&amp;uid={$user['uid']}");

			$popup->add_item($lang->show_attachments, "index.php?module=forum-attachments&amp;results=1&amp;username=".urlencode(htmlspecialchars_uni($user['username'])));

			$popup->add_item($lang->show_attachments, "index.php?module=forum-attachments&amp;results=1&amp;username=".urlencode($user['username']));

			$user['view']['controls'] = $popup->fetch();

// Fetch the reputation for this user

			$user['view']['controls'] = $popup->fetch();

// Fetch the reputation for this user

Zeile 3582Zeile 3614
				$user['view']['warninglevel'] = get_colored_warning_level($warning_level);
}


				$user['view']['warninglevel'] = get_colored_warning_level($warning_level);
}


			if($user['avatar'] && my_substr($user['avatar'], 0, 7) !== 'http://' && my_substr($user['avatar'], 0, 8) !== 'https://')
{
$user['avatar'] = "../{$user['avatar']}";
}
if($view['view_type'] == "card")
{
$scaled_avatar = fetch_scaled_avatar($user, 80, 80);
}

			if($view['view_type'] == "card")
{
$max_dimensions = '80x80';
}





			else
{

			else
{

				$scaled_avatar = fetch_scaled_avatar($user, 34, 34);
}
if(!$user['avatar'])
{
$user['avatar'] = "../".$mybb->settings['useravatar'];

				$max_dimensions = '34x34';





			}

			}

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





$avatar = format_avatar($user['avatar'], $user['avatardimensions'], $max_dimensions);

$user['view']['avatar'] = "<img src=\"".$avatar['image']."\" alt=\"\" {$avatar['width_height']} />";


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


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

Zeile 3607Zeile 3634
			if($view['view_type'] == "card")
{
$users .= build_user_view_card($user, $view, $i);

			if($view['view_type'] == "card")
{
$users .= build_user_view_card($user, $view, $i);

			}

			}

			else
{
build_user_view_table($user, $view, $table);

			else
{
build_user_view_table($user, $view, $table);

Zeile 3646Zeile 3673
	// Do we need to construct the pagination?
if($num_results > $view['perpage'])
{

	// Do we need to construct the pagination?
if($num_results > $view['perpage'])
{

		$pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&amp;type={$view['view_type']}");


		$view_type = htmlspecialchars_uni($view['view_type']);
$pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&amp;type={$view_type}");

		$search_class = "float_right";
$search_style = "";
}

		$search_class = "float_right";
$search_style = "";
}

Zeile 3677Zeile 3705
		$default_class = "search_default";
$value = $lang->search_for_user;
}

		$default_class = "search_default";
$value = $lang->search_for_user;
}

	$built_view .= $search->generate_text_box('username', $value, array('id' => 'search_keywords', 'class' => "{$default_class} field150 field_small"))."\n";

	$built_view .= $search->generate_text_box('username', htmlspecialchars_uni($value), array('id' => 'search_keywords', 'class' => "{$default_class} field150 field_small"))."\n";

	$built_view .= "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
if($view['popup'])
{

	$built_view .= "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
if($view['popup'])
{

Zeile 3691Zeile 3719
			{
search.focus();
return false;

			{
search.focus();
return false;

			}
});


			}
});


		var search = $(\"#search_keywords\");
search.focus(function()
{

		var search = $(\"#search_keywords\");
search.focus(function()
{

Zeile 3727Zeile 3755
	// TODO Select2

$built_view .= $search->end();

	// TODO Select2

$built_view .= $search->end();


if(isset($pagination))
{
$built_view .= $pagination;
}


if(isset($pagination))
{
$built_view .= $pagination;
}

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

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

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

$table->construct_row();

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

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

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

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

 
}

/**

}

/**

Zeile 3944Zeile 3945
	global $lang;

if(!is_array($fields))

	global $lang;

if(!is_array($fields))

	{

	{

		return;
}
foreach($fields as $profile_field)

		return;
}
foreach($fields as $profile_field)

Zeile 3958Zeile 3959
		switch($type)
{
case "multiselect":

		switch($type)
{
case "multiselect":

 
				$selected_options = array();

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

Zeile 3967Zeile 3969
					$user_options = $values[$field_name];
}


					$user_options = $values[$field_name];
}


				$selected_options = array();

				

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

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

Zeile 4032Zeile 4034
				}
break;
case "checkbox":

				}
break;
case "checkbox":

 
				$select_options = array();

				if(!is_array($values[$field_name]))

				if(!is_array($values[$field_name]))

				{

				{

					$user_options = explode("\n", $values[$field_name]);
}
else
{
$user_options = $values[$field_name];

					$user_options = explode("\n", $values[$field_name]);
}
else
{
$user_options = $values[$field_name];

				}



				}

$selected_options = array();

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

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

				$select_options = array();

				

				if($search == true)

				if($search == true)

				{

				{

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

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

Zeile 4058Zeile 4063
				}
break;
case "textarea":

				}
break;
case "textarea":

				$extra = '';
if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{

				$extra = '';
if(isset($mybb->input['action']) && $mybb->input['action'] == "search")
{

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


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


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

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





	if(!$input)
{
$input = $mybb->input;

	if(!$input)
{
$input = $mybb->input;

Zeile 4103Zeile 4108
	if(!is_array($input['profile_fields']))
{
$input['profile_fields'] = my_unserialize($input['profile_fields']);

	if(!is_array($input['profile_fields']))
{
$input['profile_fields'] = my_unserialize($input['profile_fields']);

	}


	}


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

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

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

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

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

	$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', htmlspecialchars_uni($input['conditions']['username']), array('id' => 'username')), 'username');

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

$options = array();

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

$options = array();

Zeile 4148Zeile 4153

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


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





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


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


Zeile 4156Zeile 4161
	while($profile_field = $db->fetch_array($query))
{
if($profile_field['required'] == 1)

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

		{

		{

			$profile_fields['required'][] = $profile_field;

			$profile_fields['required'][] = $profile_field;

		}

		}

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

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

		}
}

		}
}


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


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

Zeile 4207Zeile 4212
});
// -->
</script>';

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

 
}

/**
* @param int $source_uid
* @param int $destination_uid
*/
function merge_thread_ratings($source_uid, $destination_uid)
{
global $db;

$source_ratings = $dest_threads = $delete_list = $decrement_list = array();

// Get all thread ratings from both accounts
$query = $db->simple_select('threadratings', 'tid, uid, rid, rating', "uid IN ({$destination_uid}, {$source_uid})");
while($rating = $db->fetch_array($query))
{
if($rating['uid'] == $destination_uid)
{
$dest_threads[] = $rating['tid'];
}
else
{
$source_ratings[] = $rating;
}
}

// If there are duplicates, mark them for deletion
foreach($source_ratings as $rating)
{
if(in_array($rating['tid'], $dest_threads))
{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];
}
}

// Attribute all of the source user's ratings to the destination user
$db->update_query("threadratings", array("uid" => $destination_uid), "uid='{$source_uid}'");

// Remove ratings previously given to recently acquired threads
$query = $db->query("
SELECT tr.rid, tr.rating, t.tid
FROM {$db->table_prefix}threadratings tr
LEFT JOIN {$db->table_prefix}threads t ON (t.tid=tr.tid)
WHERE tr.uid='{$destination_uid}' AND tr.uid=t.uid
");
while($rating = $db->fetch_array($query))
{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];
}

// Delete the duplicate/disallowed ratings
if(!empty($delete_list))
{
$imp = implode(',', $delete_list);
$db->delete_query('threadratings', "rid IN ({$imp})");
}

// Correct the thread rating counters
if(!empty($decrement_list))
{
foreach($decrement_list as $tid => $ratings)
{
$db->update_query('threads', array('numratings' => 'numratings-'.count($ratings), 'totalratings' => 'totalratings-'.array_sum($ratings)), "tid='{$tid}'", 1, true);
}
}

}

}