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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: users.php 5765 2012-03-27 09:52:45Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 149Zeile 149
if($mybb->input['action'] == "avatar_gallery")
{
$plugins->run_hooks("admin_user_users_avatar_gallery");

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

	



	$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	$user = get_user($mybb->input['uid']);
if(!$user['uid'])

	{
exit;
}


	{
exit;
}


	// We've selected a new avatar for this user!

	// We've selected a new avatar for this user!

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

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

	{

	{

	if(!verify_post_check($mybb->input['my_post_key']))

		if(!verify_post_check($mybb->input['my_post_key']))

		{
echo $lang->invalid_post_verify_key2;
exit;

		{
echo $lang->invalid_post_verify_key2;
exit;

Zeile 175Zeile 175
				"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",
"avatartype" => "gallery"
);

				"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",
"avatartype" => "gallery"
);





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

$plugins->run_hooks("admin_user_users_avatar_gallery_commit");

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

$plugins->run_hooks("admin_user_users_avatar_gallery_commit");

Zeile 188Zeile 188
		echo "<script type=\"text/javascript\">window.parent.submitUserForm();</script>";
exit;
}

		echo "<script type=\"text/javascript\">window.parent.submitUserForm();</script>";
exit;
}





	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo "<head profile=\"http://gmpg.org/xfn/1\">\n";

	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo "<head profile=\"http://gmpg.org/xfn/1\">\n";

Zeile 201Zeile 201
	echo "<body id=\"avatar_gallery\">\n";

// Sanitize incoming path if we have one

	echo "<body id=\"avatar_gallery\">\n";

// Sanitize incoming path if we have one

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





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

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

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





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

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

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

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

	{

	{

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

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

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

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

	{

	{

		$path = $gallery."/";
$real_path = $mybb->settings['avatardir']."/".$path;
if(is_dir($real_path))

		$path = $gallery."/";
$real_path = $mybb->settings['avatardir']."/".$path;
if(is_dir($real_path))

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

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

	

	

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

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

Zeile 300Zeile 304
					"width" => $dimensions[0],
"height" => $dimensions[1]
);

					"width" => $dimensions[0],
"height" => $dimensions[1]
);

			}
}
}

require_once MYBB_ROOT."inc/functions_image.php";

			}
}
}

require_once MYBB_ROOT."inc/functions_image.php";


// Now we're done, we can simply show our gallery page
echo "<div id=\"gallery_breadcrumb\">{$breadcrumb}</div>\n";
echo "<div id=\"gallery\">\n";
echo "<ul id=\"galleries\">\n";
if(is_array($sub_galleries))


// Now we're done, we can simply show our gallery page
echo "<div id=\"gallery_breadcrumb\">{$breadcrumb}</div>\n";
echo "<div id=\"gallery\">\n";
echo "<ul id=\"galleries\">\n";
if(is_array($sub_galleries))

	{

	{

		foreach($sub_galleries as $gallery)
{
if(!$gallery['thumb'])

		foreach($sub_galleries as $gallery)
{
if(!$gallery['thumb'])

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

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

		}
}
echo "</ul>\n";

		}
}
echo "</ul>\n";

	// Build the list of any actual avatars we have
echo "<ul id=\"avatars\">\n";
if(is_array($avatars))

	// Build the list of any actual avatars we have
echo "<ul id=\"avatars\">\n";
if(is_array($avatars))

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

	echo "</html>";
exit;
}





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

if(!verify_post_check($mybb->input['my_post_key']))

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

if(!verify_post_check($mybb->input['my_post_key']))

	{

	{

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

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

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

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

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

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


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


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

Zeile 374Zeile 378

// Update
if($user['coppauser'])


// Update
if($user['coppauser'])

	{

	{

		$updated_user = array(
"coppauser" => 0
);
}
else

		$updated_user = array(
"coppauser" => 0
);
}
else

	{

	{

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

// Move out of awaiting activation if they're in it.
if($user['usergroup'] == 5)

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

// Move out of awaiting activation if they're in it.
if($user['usergroup'] == 5)

	{

	{

		$updated_user['usergroup'] = 2;
}

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

$plugins->run_hooks("admin_user_users_coppa_activate_commit");

		$updated_user['usergroup'] = 2;
}

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

$plugins->run_hooks("admin_user_users_coppa_activate_commit");





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


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


Zeile 406Zeile 410
		else
{
$message = $lang->success_activated;

		else
{
$message = $lang->success_activated;

		}


		}


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

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

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

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

		}
}

		}
}

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

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

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

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

		}
else
{

		}
else
{

			$additionalgroups = '';
}

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

			$additionalgroups = '';
}

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





		// Set the data for the new user.
$new_user = array(
"uid" => $mybb->input['uid'],

		// Set the data for the new user.
$new_user = array(
"uid" => $mybb->input['uid'],

Zeile 485Zeile 489
		// Set the data of the user in the datahandler.
$userhandler->set_data($new_user);
$errors = '';

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

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

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

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

	}


	}


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

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

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

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

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

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





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

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

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

$display_group_options[0] = $lang->use_primary_user_group;

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

$display_group_options[0] = $lang->use_primary_user_group;

 
	$options = array();

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

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

	}

	}


$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 563Zeile 568
if($mybb->input['action'] == "edit")
{
$plugins->run_hooks("admin_user_users_edit");

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

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

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


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

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


	if($mybb->request_method == "post")
{
if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))

	if($mybb->request_method == "post")
{
if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))

Zeile 725Zeile 730
			else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
{
$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']);

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

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

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

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

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

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

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

Zeile 733Zeile 738
				if(!$file)
{
$avatar_error = $lang->error_invalidavatarurl;

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

				}

				}

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

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

Zeile 752Zeile 757
						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'] != "")

					{

					{

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

						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(empty($avatar_error))

Zeile 785Zeile 790
				else
{
$errors = array($avatar_error);

				else
{
$errors = array($avatar_error);

				}

				}

			}

// Moderator "Options" (suspend signature, suspend/moderate posting)

			}

// Moderator "Options" (suspend signature, suspend/moderate posting)

Zeile 907Zeile 912
	{
$user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
$mybb->input = $user;

	{
$user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
$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'
);

foreach($options as $option)
{
if(!isset($mybb->input[$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 921Zeile 941
	}
else
{

	}
else
{

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

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


if($user['birthday'])
{


if($user['birthday'])
{

Zeile 995Zeile 1015
			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 (!stristr($user['avatar'], 'http://'))
{
$user['avatar'] = "../{$user['avatar']}\n";

		if (!stristr($user['avatar'], 'http://'))
{
$user['avatar'] = "../{$user['avatar']}\n";

Zeile 1015Zeile 1035
			"width" => 120,
"height" => 120
);

			"width" => 120,
"height" => 120
);

	}

	}

	$avatar_top = ceil((126-$scaled_dimensions['height'])/2);
if($user['lastactive'])
{

	$avatar_top = ceil((126-$scaled_dimensions['height'])/2);
if($user['lastactive'])
{

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

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

	}
else

	}
else

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

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

	}


	}


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

// Fetch the reputation for this user

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

// Fetch the reputation for this user

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

	else
{
$reputation = "-";

	}


	}


	if($mybb->settings['enablewarningsystem'] != 0 && $user_permissions['canreceivewarnings'] != 0)
{
$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

	if($mybb->settings['enablewarningsystem'] != 0 && $user_permissions['canreceivewarnings'] != 0)
{
$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

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

$display_group_options[0] = $lang->use_primary_user_group;

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

$display_group_options[0] = $lang->use_primary_user_group;

 
	$options = array();

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
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))
{

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

// Output custom profile fields - required

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

// Output custom profile fields - required

 
	if(!isset($profile_fields['required']))
{
$profile_fields['required'] = array();
}

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

$form_container->end();

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

$form_container->end();

Zeile 1365Zeile 1390
	else
{
$sig_checked = 0;

	else
{
$sig_checked = 0;

 
		$user_suspend_info = '';

	}

$actions = '

	}

$actions = '

Zeile 1415Zeile 1441
		$form->generate_radio_button("update_posts", "no", $lang->do_nothing, array("checked" => 1))
);


		$form->generate_radio_button("update_posts", "no", $lang->do_nothing, array("checked" => 1))
);


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

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


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


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

Zeile 1429Zeile 1455

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



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


 
	$avatar_url = '';

	if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>";

	if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>";

Zeile 1511Zeile 1538
	$modpost_options = $form->generate_select_box('modpost_period', $periods, $mybb->input['modpost_period'], array('id' => 'modpost_period'));

// Do we have any existing suspensions here?

	$modpost_options = $form->generate_select_box('modpost_period', $periods, $mybb->input['modpost_period'], array('id' => 'modpost_period'));

// Do we have any existing suspensions here?

 
	$existing_info = '';

	if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))
{
$mybb->input['moderateposting'] = 1;

	if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))
{
$mybb->input['moderateposting'] = 1;

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

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

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

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

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

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

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

		$db->delete_query("awaitingactivation", "uid='{$uid}'");




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


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

// Update forums & threads if user is the lastposter

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

// Update forums & threads if user is the lastposter

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

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


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


Zeile 1697Zeile 1727
	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);

	}
}


	}
}


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

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

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





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

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

	{

	{

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

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

	}

	}

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


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


	echo build_users_view($admin_view);















	$view = build_users_view($admin_view);

// No referred users
if(!$view)
{
$table = new Table;
$table->construct_cell($lang->error_no_referred_users);
$table->construct_row();
$table->output($lang->show_referrers);
}
else
{
echo $view;
}


	$page->output_footer();
}


	$page->output_footer();
}


Zeile 1845Zeile 1888
		
// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
if(!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid'])))

		
// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
if(!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid'])))

		{

		{

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

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

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

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





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

// Additional updates for non-uid fields

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

// Additional updates for non-uid fields

Zeile 2057Zeile 2100
}

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

}

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

{

{

	$plugins->run_hooks("admin_user_users_search");

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

	$plugins->run_hooks("admin_user_users_search");

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

		{

		{

			$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);

			$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);

			}

			}

		}

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

		}

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

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

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

		}

		}

		
if(intval($mybb->input['perpage']))
{

		
if(intval($mybb->input['perpage']))
{

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

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

		}

		}


$results = build_users_view($admin_view);



$results = build_users_view($admin_view);


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

// If we have any error messages, show them

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

// If we have any error messages, show them

	if($errors)

	if($errors)

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

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

Zeile 2268Zeile 2311
			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", "usergroup = '5' AND uid IN (".$sql_array.")");
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))

Zeile 2371Zeile 2414
					else
{
$lifted = ban_date2timestamp($mybb->input['bantime']);

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

					}


					}


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

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

Zeile 2528Zeile 2571
					$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);

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

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


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


Zeile 2547Zeile 2590
					{
// Is the date sort of valid?
if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29))

					{
// Is the date sort of valid?
if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29))

						{

						{

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


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


Zeile 2560Zeile 2603

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


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

						{

						{

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


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


Zeile 2580Zeile 2623
						{
case '1':
$threshold = $base_time * 31; // 1 month = 31 days, in the standard terms

						{
case '1':
$threshold = $base_time * 31; // 1 month = 31 days, in the standard terms

								break;

								break;

							case '2':
$threshold = $base_time * 93; // 3 months = 31 days * 3

							case '2':
$threshold = $base_time * 93; // 3 months = 31 days * 3

								break;

								break;

							case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2

							case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2

								break;

								break;

							case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;
case '5':
$threshold = $base_time * 548; // 18 months = 365 + 183

							case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;
case '5':
$threshold = $base_time * 548; // 18 months = 365 + 183

								break;

								break;

							case '6':
$threshold = $base_time * 730; // 2 years = 365 * 2
break;

							case '6':
$threshold = $base_time * 730; // 2 years = 365 * 2
break;

Zeile 2604Zeile 2647
							$errors[] = $lang->no_set_option;
}
else

							$errors[] = $lang->no_set_option;
}
else

						{

						{

							$date = TIME_NOW - $threshold;
}
}

							$date = TIME_NOW - $threshold;
}
}

Zeile 2630Zeile 2673
							if($return_array && is_array($return_array))
{
$prune_array = array_merge_recursive($prune_array, $return_array);

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

						// 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 the rebuild functions

						require_once(MYBB_ROOT.'/inc/functions.php');
require_once(MYBB_ROOT.'/inc/functions_rebuild.php');

						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)


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

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

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

								$db->delete_query("polls", "tid='$tid'");;

								$db->delete_query("polls", "tid='$tid'");

								$db->delete_query("threadsread", "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)


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

Zeile 2688Zeile 2732
						//log_admin_action();
my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie
flash_message($lang->prune_complete, 'success');

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

						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;

				
// Display a table warning
$table = new Table;

Zeile 2727Zeile 2771
				$month_options = array();
$month_options[] = "&nbsp;";
for($i = 1; $i <= 12; ++$i)

				$month_options = array();
$month_options[] = "&nbsp;";
for($i = 1; $i <= 12; ++$i)

				{

				{

					$string = "month_{$i}";
$month_options[] = $lang->$string;
}

					$string = "month_{$i}";
$month_options[] = $lang->$string;
}

Zeile 2745Zeile 2789
				{
$string = "option_{$i}";
$set_options[] = $lang->$string;

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


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


Zeile 2838Zeile 2882

// Usergroups
$display_group_options[0] = $lang->use_primary_user_group;


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

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

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


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


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

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

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

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

Zeile 2882Zeile 2927
	else
{
// Showing a specific view

	else
{
// Showing a specific view

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

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

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

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

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

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

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

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

			{

			{

				unset($admin_view);

				unset($admin_view);

			}
}

			}
}


// Don't have a view? Fetch the default


// Don't have a view? Fetch the default

		if(!$admin_view)

		if(!isset($admin_view))

		{
$default_view = fetch_default_view("user");
if(!$default_view)

		{
$default_view = fetch_default_view("user");
if(!$default_view)

Zeile 2907Zeile 2952
	}

// Fetch a list of all of the views for this user

	}

// Fetch a list of all of the views for this user

	$popup = new PopupMenu("views", $lang->views);

	$popup = new PopupMenu("views", $lang->views);


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


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

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


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


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

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

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

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

Zeile 2960Zeile 3005
{
global $mybb, $db, $cache, $lang, $user_view_fields, $page;


{
global $mybb, $db, $cache, $lang, $user_view_fields, $page;


 
	$view_title = '';

	if($view['title'])
{
$title_string = "view_title_{$view['vid']}";

	if($view['title'])
{
$title_string = "view_title_{$view['vid']}";

Zeile 2973Zeile 3019
	}

// Build the URL to this view

	}

// Build the URL to this view

	if(!$view['url'])

	if(!isset($view['url']))

	{
$view['url'] = "index.php?module=user-users";
}

	{
$view['url'] = "index.php?module=user-users";
}

Zeile 2989Zeile 3035
	{
$view['custom_profile_fields'] = unserialize($view['custom_profile_fields']);
}

	{
$view['custom_profile_fields'] = unserialize($view['custom_profile_fields']);
}

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

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

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

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

Zeile 3001Zeile 3047
	{
// If this is a custom view we need to save everything ready to pass it on from page to page
global $admin_session;

	{
// If this is a custom view we need to save everything ready to pass it on from page to page
global $admin_session;

		if(!$_REQUEST['search_id'])

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

		{
$search_id = md5(random_str());
$admin_session['data']['user_views'][$search_id] = $view;
update_admin_session('user_views', $admin_session['data']['user_views']);

		{
$search_id = md5(random_str());
$admin_session['data']['user_views'][$search_id] = $view;
update_admin_session('user_views', $admin_session['data']['user_views']);

			$_REQUEST['search_id'] = $search_id;

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

		}

		}

		$view['url'] .= "&amp;search_id=".htmlspecialchars($_REQUEST['search_id']);

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

	}


	}


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

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

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

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

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

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

	}

	}

	
if(isset($view['conditions']['referrer'])){

	
if(isset($view['conditions']['referrer'])){

		$view['url'] .= "&amp;action=referrers&amp;uid=".htmlspecialchars($view['conditions']['referrer']);

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

	}

// Do we not have any views?

	}

// Do we not have any views?

Zeile 3065Zeile 3111
	$user_like_fields = array("username", "email", "website", "icq", "aim", "yahoo", "msn", "signature", "usertitle");
foreach($user_like_fields as $search_field)
{

	$user_like_fields = array("username", "email", "website", "icq", "aim", "yahoo", "msn", "signature", "usertitle");
foreach($user_like_fields as $search_field)
{

		if($view['conditions'][$search_field] && !$view['conditions'][$search_field.'_blank'])

		if(!empty($view['conditions'][$search_field]) && !$view['conditions'][$search_field.'_blank'])

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

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

		else if(isset($view['conditions'][$search_field.'_blank']))

		else if(!empty($view['conditions'][$search_field.'_blank']))

		{
$search_sql .= " AND u.{$search_field} != ''";
}

		{
$search_sql .= " AND u.{$search_field} != ''";
}

Zeile 3079Zeile 3125
	$user_exact_fields = array("referrer");
foreach($user_exact_fields as $search_field)
{

	$user_exact_fields = array("referrer");
foreach($user_exact_fields as $search_field)
{

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

		if(!empty($view['conditions'][$search_field]))

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

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

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

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

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

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

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

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

Zeile 3111Zeile 3157
	$reg_fields = array("regdate");
foreach($reg_fields as $search_field)
{

	$reg_fields = array("regdate");
foreach($reg_fields as $search_field)
{

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

		if(!empty($view['conditions'][$search_field]) && intval($view['conditions'][$search_field]))

		{
$threshold = TIME_NOW - (intval($view['conditions'][$search_field]) * 24 * 60 * 60);


		{
$threshold = TIME_NOW - (intval($view['conditions'][$search_field]) * 24 * 60 * 60);


Zeile 3123Zeile 3169
	$ip_fields = array("regip", "lastip");
foreach($ip_fields as $search_field)
{

	$ip_fields = array("regip", "lastip");
foreach($ip_fields as $search_field)
{

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

		if(!empty($view['conditions'][$search_field]))

		{
// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)
{
$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";

		{
// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)
{
$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";

			}
else

			}
else

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

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

Zeile 3144Zeile 3190
				}
}
$search_sql .= " AND {$ip_sql}";

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

		}
}

		}
}


// Post IP searching


// Post IP searching

	if($view['conditions']['postip'])

	if(!empty($view['conditions']['postip']))

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

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

		{

		{

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

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

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

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

			{

			{

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

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

					}


					}


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

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

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

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

					{

					{

						$column = str_replace('_blank', '', $column);
$userfield_sql .= ' AND '.$db->escape_string($column)." != ''";
}

						$column = str_replace('_blank', '', $column);
$userfield_sql .= ' AND '.$db->escape_string($column)." != ''";
}

Zeile 3212Zeile 3258
			else if(!empty($input))
{
if($input == $lang->na)

			else if(!empty($input))
{
if($input == $lang->na)

				{

				{

					continue;
}


					continue;
}


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

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

			}

			}

		}

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

		}

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

Zeile 3238Zeile 3284
			}
$search_sql .= " AND u.uid IN(".implode(',', $userfield_uids).")";
unset($userfield_uids);

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

		}

		}

	}

// Usergroup based searching

	}

// Usergroup based searching

	if($view['conditions']['usergroup'])

	if(isset($view['conditions']['usergroup']))

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

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

Zeile 3273Zeile 3319
	}

// COPPA users only?

	}

// COPPA users only?

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

	if(isset($view['conditions']['coppa']))
{

		$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";
}

// Extra SQL?

		$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";
}

// Extra SQL?

	if($view['extra_sql'])

	if(isset($view['extra_sql']))

	{
$search_sql .= $view['extra_sql'];
}

	{
$search_sql .= $view['extra_sql'];
}

Zeile 3294Zeile 3340
	
// No matching results then return false
if(!$num_results)

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

	{

	{

		return false;
}
// Generate the list of results

		return false;
}
// Generate the list of results

Zeile 3303Zeile 3349
		if(!$view['perpage'])
{
$view['perpage'] = 20;

		if(!$view['perpage'])
{
$view['perpage'] = 20;

		}

		}

		$view['perpage'] = intval($view['perpage']);

// Establish which page we're viewing and the starting index for querying

		$view['perpage'] = intval($view['perpage']);

// Establish which page we're viewing and the starting index for querying

		$mybb->input['page'] = intval($mybb->input['page']);










		// Establish which page we're viewing and the starting index for querying
if(!isset($mybb->input['page']))
{
$mybb->input['page'] = 1;
}
else
{
$mybb->input['page'] = intval($mybb->input['page']);
}


		if($mybb->input['page'])
{
$start = ($mybb->input['page'] - 1) * $view['perpage'];

		if($mybb->input['page'])
{
$start = ($mybb->input['page'] - 1) * $view['perpage'];

Zeile 3319Zeile 3374
		}

$from_bit = "";

		}

$from_bit = "";

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

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

		{
$from_bit = "&amp;from=home";
}

		{
$from_bit = "&amp;from=home";
}

Zeile 3357Zeile 3412
			ORDER BY {$view['sortby']} {$view['sortorder']}
LIMIT {$start}, {$view['perpage']}
");

			ORDER BY {$view['sortby']} {$view['sortorder']}
LIMIT {$start}, {$view['perpage']}
");

 
		$users = '';

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

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

		{			


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

			$additional_groups = explode(",", $user['additionalgroups']);
$comma = $groups_list = '';
foreach($additional_groups as $group)

			if($user['additionalgroups'])



			{

			{

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






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

foreach($additional_groups as $group)
{
$groups_list .= "{$comma}{$usergroups[$group]['title']}";
$comma = $lang->comma;
}

			}
if(!$groups_list)
{

			}
if(!$groups_list)
{

Zeile 3404Zeile 3464
			if($usergroups[$user['usergroup']]['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
{
$user['view']['reputation'] = get_reputation($user['reputation']);

			if($usergroups[$user['usergroup']]['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
{
$user['view']['reputation'] = get_reputation($user['reputation']);

			}
else

			}
else

			{
$reputation = "-";
}

			{
$reputation = "-";
}

Zeile 3418Zeile 3478
					$warning_level = 100;
}
$user['view']['warninglevel'] = get_colored_warning_level($warning_level);

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

			}


			}


			if($user['avatar'] && !stristr($user['avatar'], 'http://'))

			if($user['avatar'] && !stristr($user['avatar'], 'http://'))

			{

			{

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

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

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

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

				$scaled_avatar = fetch_scaled_avatar($user, 80, 80);
}
else

				$scaled_avatar = fetch_scaled_avatar($user, 80, 80);
}
else

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

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

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

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

			{

			{

				$users .= build_user_view_card($user, $view, $i);
}
else

				$users .= build_user_view_card($user, $view, $i);
}
else

Zeile 3456Zeile 3516
		}
}


		}
}


	if(!$view['table_id'])

	if(!isset($view['table_id']))

	{
$view['table_id'] = "users_list";

	{
$view['table_id'] = "users_list";

	}

	}


$switch_view = "<div class=\"float_right\">";
$switch_url = $view['url'];


$switch_view = "<div class=\"float_right\">";
$switch_url = $view['url'];

Zeile 3501Zeile 3561
	$built_view = $search->construct_return;
$built_view .= "<div class=\"{$search_class}\" style=\"padding-bottom: 3px; margin-top: -9px; {$search_style}\">";
$built_view .= $search->generate_hidden_field('action', 'search')."\n";

	$built_view = $search->construct_return;
$built_view .= "<div class=\"{$search_class}\" style=\"padding-bottom: 3px; margin-top: -9px; {$search_style}\">";
$built_view .= $search->generate_hidden_field('action', 'search')."\n";

	if($view['conditions']['username'])

	if(isset($view['conditions']['username']))

	{
$default_class = '';
$value = $view['conditions']['username'];

	{
$default_class = '';
$value = $view['conditions']['username'];

Zeile 3521Zeile 3581
		var form = document.getElementById('search_form');
form.onsubmit = function() {
var search = document.getElementById('search_keywords');

		var form = document.getElementById('search_form');
form.onsubmit = function() {
var search = document.getElementById('search_keywords');

			if(search.value == '' || search.value == '{$lang->search_for_user}')

			if(search.value == '' || search.value == '".addcslashes($lang->search_for_user, "'")."')

			{
search.focus();
return false;

			{
search.focus();
return false;

Zeile 3531Zeile 3591
		var search = document.getElementById('search_keywords');
search.onfocus = function()
{

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

			if(this.value == '{$lang->search_for_user}')

			if(this.value == '".addcslashes($lang->search_for_user, "'")."')

			{
$(this).removeClassName('search_default');
this.value = '';

			{
$(this).removeClassName('search_default');
this.value = '';

Zeile 3542Zeile 3602
			if(this.value == '')
{
$(this).addClassName('search_default');

			if(this.value == '')
{
$(this).addClassName('search_default');

				this.value = '{$lang->search_for_user}';

				this.value = '".addcslashes($lang->search_for_user, "'")."';

			}
}
// fix the styling used if we have a different default value

			}
}
// fix the styling used if we have a different default value

        if(search.value != '{$lang->search_for_user}')
{
$(search).removeClassName('search_default');
}

		if(search.value != '".addcslashes($lang->search_for_user, "'")."')
{
$(search).removeClassName('search_default');
}

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


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


Zeile 3561Zeile 3621
		new autoComplete("search_keywords", "../xmlhttp.php?action=get_users", {valueSpan: "username"});
// -->
</script>';

		new autoComplete("search_keywords", "../xmlhttp.php?action=get_users", {valueSpan: "username"});
// -->
</script>';

	



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


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


	$built_view .= $pagination;




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

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

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

	}

	}

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

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

	$built_view .= $pagination;




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


$built_view .= '
<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1400"></script>


$built_view .= '
<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1400"></script>

Zeile 3638Zeile 3704
		// Otherwise, just user data
else if($field != "username")
{

		// Otherwise, just user data
else if($field != "username")
{

			if($user['view'][$field])

			if(isset($user['view'][$field]))

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

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

Zeile 3854Zeile 3920
				break;
case "textarea":
$extra = '';

				break;
case "textarea":
$extra = '';

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

				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 3863Zeile 3929
				break;
default:
$extra = '';

				break;
default:
$extra = '';

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

				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 3905Zeile 3971
	$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
$form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');


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


 
	$options = array();

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