Vergleich admin/modules/user/users.php - 1.4.5 - 1.4.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: users.php 4337 2009-03-30 01:21:51Z Tikitiki $

 * $Id: users.php 4657 2009-12-24 20:31:25Z RyanGordon $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 159Zeile 159
	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

 
		$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']),
"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",

		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']),
"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",



 
				"avatartype" => "gallery"
);


				"avatartype" => "gallery"
);


Zeile 308Zeile 309
				$gallery['thumb'] = "styles/{$page->style}/images/avatar_gallery.gif";
$gallery['thumb_width'] = 64;
$gallery['thumb_height'] = 64;

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

			}

			}

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

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

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

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

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

			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 338Zeile 339
	echo "</html>";
exit;
}

	echo "</html>";
exit;
}





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

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

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

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

		}
else

		}
else

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

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

		}
}


		}
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Zeile 445Zeile 446
		{
$additionalgroups = '';
}

		{
$additionalgroups = '';
}





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

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

Zeile 456Zeile 457
			"username" => $mybb->input['username'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['confirm_password'],

			"username" => $mybb->input['username'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['confirm_password'],

			"email" => $mybb->input['email'],
"email2" => $mybb->input['email'],
"usergroup" => $mybb->input['usergroup'],
"additionalgroups" => $additionalgroups,
"displaygroup" => $mybb->input['displaygroup'],
"profile_fields" => $mybb->input['profile_fields'],

			"email" => $mybb->input['email'],
"email2" => $mybb->input['email'],
"usergroup" => $mybb->input['usergroup'],
"additionalgroups" => $additionalgroups,
"displaygroup" => $mybb->input['displaygroup'],
"profile_fields" => $mybb->input['profile_fields'],

			"profile_fields_editable" => true,
);


			"profile_fields_editable" => true,
);


Zeile 473Zeile 474
		if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

		if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

		}

		}

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

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

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

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

	{

	{

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


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


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

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

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

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

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

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

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

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

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

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

Zeile 643Zeile 644
			"showcodebuttons" => intval($mybb->input['showcodebuttons']),
"pmnotify" => $mybb->input['pmnotify'],
"showredirect" => $mybb->input['showredirect']

			"showcodebuttons" => intval($mybb->input['showcodebuttons']),
"pmnotify" => $mybb->input['pmnotify'],
"showredirect" => $mybb->input['showredirect']

		);

		);


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


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

Zeile 924Zeile 925
	}
else
{

	}
else
{

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

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

	}

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

	}

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

Zeile 960Zeile 961
		$age = '';
}


		$age = '';
}


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

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

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

Zeile 1125Zeile 1126
			{
if($ppp <= 0) continue;
$ppp_options[$ppp] = $ppp;

			{
if($ppp <= 0) continue;
$ppp_options[$ppp] = $ppp;

			}

			}

		}
}


		}
}


Zeile 1184Zeile 1185
		$form->generate_radio_button("update_posts", "enable", $lang->enable_sig_in_all_posts, array("checked" => 0)),
$form->generate_radio_button("update_posts", "disable", $lang->disable_sig_in_all_posts, array("checked" => 0)),
$form->generate_radio_button("update_posts", "no", $lang->do_nothing, array("checked" => 1))

		$form->generate_radio_button("update_posts", "enable", $lang->enable_sig_in_all_posts, array("checked" => 0)),
$form->generate_radio_button("update_posts", "disable", $lang->disable_sig_in_all_posts, array("checked" => 0)),
$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->singature_preferences, "", implode("<br />", $signature_options));





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

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


//


//

	// AVATAR MANAGER
//
echo "<div id=\"tab_avatar\">\n";
$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	// AVATAR MANAGER
//
echo "<div id=\"tab_avatar\">\n";
$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"{$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));


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

	}

	}

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

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

	}

	}

	elseif($user['avatartype'] == "remote" || my_strpos(my_strtolower($user['avatar']), "http://") !== false)
{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>";

	elseif($user['avatartype'] == "remote" || my_strpos(my_strtolower($user['avatar']), "http://") !== false)
{
$current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>";

Zeile 1215Zeile 1216
	}

if($errors)

	}

if($errors)

	{

	{

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


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


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

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

	

	

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


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


Zeile 1345Zeile 1346
	);

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

	);

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

	

	

	// Fetch default admin view
$default_view = fetch_default_view("user");
if(!$default_view)

	// Fetch default admin view
$default_view = fetch_default_view("user");
if(!$default_view)

	{

	{

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

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

Zeile 1364Zeile 1365
	$admin_view['conditions']['referrer'] = $mybb->input['uid'];

echo build_users_view($admin_view);

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

echo build_users_view($admin_view);

	
$page->output_footer();
}


	
$page->output_footer();
}


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

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

	

	

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


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


Zeile 1382Zeile 1383
	);

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

	);

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

	

	

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


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


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

$table = new Table;

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

$table = new Table;

	

	

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

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

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

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

		$controls = '';

		$controls = '';

	}
else
{

	}
else
{

Zeile 1487Zeile 1488

// Only carry over admin options/permissions if we don't already have them
if(!$existing_admin_options)


// Only carry over admin options/permissions if we don't already have them
if(!$existing_admin_options)

			{

			{

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

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

			}


			}


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

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

Zeile 1500Zeile 1501
			$db->update_query("pollvotes", $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("pollvotes", $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("reputation", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reputation", array('adduid' => $destination_user['uid']), "adduid='{$source_user['uid']}'");

 
			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->delete_query("sessions", "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->delete_query("sessions", "uid='{$source_user['uid']}'");

			$db->delete_query("reputation", "uid='{$destination_user['uid']}' AND adduid='{$destination_user['uid']}'");
















			
// Merging Reputation
$query = $db->simple_select("reputation", "rid, uid", "adduid = '{$source_user['uid']}' OR adduid = '{$uid_update['uid']}'", array("order_by" => "dateline", "order_dir" => "DESC"));
while($result = $db->fetch_array($query))
{
// Let's try and remove old one if it's the same uid
if($result['uid'] == $last['uid'])
{
$db->delete_query("reputation", "rid = '".$result['rid']."'");
$db->update_query("reputation", array("adduid" => $uid_update['uid']), "rid = '".$last['rid']."'");
}
$last = array(
"rid" => $result['rid'],
"uid" => $result['uid']
);
}

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

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

			








// No reputation?
if(!$total_reputation)
{
$total_reputation = '0';
}


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

// Additional updates for non-uid fields

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

// Additional updates for non-uid fields

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

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

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

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

			
// Update user post count

			
// Update user post count

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."'");

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");

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

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

 
			
// Use the earliest registration date
if($destination_user['regdate'] > $source_user['regdate'])
{
$db->update_query("users", array('regdate' => $source_user['regdate']), "uid='{$destination_user['uid']}'");
}


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



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


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

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

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

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


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 1695Zeile 1735
	$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($errors)
{
$page->output_inline_error($errors);
}



// If we have any error messages, show them
if($errors)
{
$page->output_inline_error($errors);
}


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

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

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

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





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

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





	$page->output_footer();
}

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

	$page->output_footer();
}

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

	

	

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


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


Zeile 1791Zeile 1831
	{
// If we came from the home page and clicked on the "Activate Users" link, send them back to here
if($admin_session['data']['from'] == "home")

	{
// If we came from the home page and clicked on the "Activate Users" link, send them back to here
if($admin_session['data']['from'] == "home")

		{

		{

			flash_message($admin_session['data']['flash_message2']['message'], $admin_session['data']['flash_message2']['type']);
update_admin_session('flash_message2', '');
update_admin_session('from', '');

			flash_message($admin_session['data']['flash_message2']['message'], $admin_session['data']['flash_message2']['type']);
update_admin_session('flash_message2', '');
update_admin_session('from', '');

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

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

 
		echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n";

		$page->output_inline_error($errors);
}


		$page->output_inline_error($errors);
}


Zeile 1851Zeile 1892
	if($view['vid'])
{
$view['url'] .= "&amp;vid={$view['vid']}";

	if($view['vid'])
{
$view['url'] .= "&amp;vid={$view['vid']}";

	}

	}

	else
{
// If this is a custom view we need to save everything ready to pass it on from page to page

	else
{
// If this is a custom view we need to save everything ready to pass it on from page to page

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

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

	}


	}


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

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

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

		update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));







		update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));
}

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

	}

$table = new Table;

	}

$table = new Table;

Zeile 1909Zeile 1956
	// List of valid LIKE search fields
$user_like_fields = array("username", "email", "website", "icq", "aim", "yahoo", "msn", "signature", "usertitle");
foreach($user_like_fields as $search_field)

	// List of valid LIKE search fields
$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])
{

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

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

		}
}


		}
}


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

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

	{

	{

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

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

Zeile 1940Zeile 1987
					break;
case "less_than":
$direction = "<";

					break;
case "less_than":
$direction = "<";

					break;
default:

					break;
default:

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

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

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

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

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

Zeile 1964Zeile 2011
			{
$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))

				{

				{

					$ip_sql = "long{$search_field}='{$ip_range}'";
}
else
{
$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
}

					$ip_sql = "long{$search_field}='{$ip_range}'";
}
else
{
$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
}

			}

			}

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

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

Zeile 2085Zeile 2132
		
switch($view['sortby'])
{

		
switch($view['sortby'])
{

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

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

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

 
				$view['sortby'] = $db->escape_string($view['sortby']);
break;
case "numposts":
$view['sortby'] = "postnum";
break;

			case "warninglevel":

			case "warninglevel":

 
				$view['sortby'] = "warningpoints";

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

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

Zeile 2189Zeile 2239
			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

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

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


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


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

Zeile 2523Zeile 2573
				foreach($select_options as $val)
{
$val = trim($val);

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

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

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

				}
break;
case "textarea":

				}
break;
case "textarea":