Vergleich admin/modules/user/users.php - 1.8.11 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 2092Zeile 2092
				"ignorelist" => $ignored
);
$db->update_query("users", $lists, "uid='{$destination_user['uid']}'");

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


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

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

 

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


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

Zeile 2119Zeile 2112
			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

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

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


// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");


// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");

Zeile 2137Zeile 2130
			}

$plugins->run_hooks("admin_user_users_merge_commit");

			}

$plugins->run_hooks("admin_user_users_merge_commit");

 

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

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


$cache->update_awaitingactivation();



$cache->update_awaitingactivation();


Zeile 2550Zeile 2550
				if($mybb->input['bantime'] == '---')
{
$lifted = 0;

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

				}
else

				}
else

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

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





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

$banned_count = 0;

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

$banned_count = 0;

Zeile 2578Zeile 2578
							"reason" => $db->escape_string($reason)
);
$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");

							"reason" => $db->escape_string($reason)
);
$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");

					}

					}

					else
{
// Not currently banned - insert the ban

					else
{
// Not currently banned - insert the ban

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

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

			}


			}


			$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiban');

			$form = new Form("index.php?module=user-users", "post");
echo $form->generate_hidden_field('action', 'inline_edit');
echo $form->generate_hidden_field('inline_action', 'multiban');

Zeile 2663Zeile 2663
			break;
case 'multidelete':
if($mybb->input['no'])

			break;
case 'multidelete':
if($mybb->input['no'])

			{

			{

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

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

Zeile 2720Zeile 2720
					// Check the month
$months = get_bdays($year);
if($day > $months[$month-1])

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

					{

					{

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


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


Zeile 2777Zeile 2777
				else
{
$errors[] = $lang->no_prune_option;

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

				}

if(!$errors)
{

				}

if(!$errors)
{

					$sql_array = implode(",", $selected);
$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");

					$sql_array = implode(",", $selected);
$prune_array = array();
$query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");

Zeile 2788Zeile 2788
					{
// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))

					{
// Protect Super Admins
if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))

						{

						{

							continue;

							continue;

						}


						}


						$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete
if($return_array && is_array($return_array))
{

						$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete
if($return_array && is_array($return_array))
{

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

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





					// We've finished deleting user's posts, so let's delete the threads
if(is_array($prune_array['to_delete']) && count($prune_array['to_delete']) > 0)
{

					// 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 2866Zeile 2866
			$table = new Table;
$lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected));
$table->construct_cell($lang->mass_prune_info);

			$table = new Table;
$lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected));
$table->construct_cell($lang->mass_prune_info);

			$table->construct_row();

			$table->construct_row();

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

if($errors)

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

if($errors)

Zeile 2924Zeile 2924
			break;
case 'multiusergroup':
if($mybb->input['processed'] == 1)

			break;
case 'multiusergroup':
if($mybb->input['processed'] == 1)

			{

			{

				// Determine additional usergroups
if(is_array($mybb->input['additionalgroups']))
{

				// Determine additional usergroups
if(is_array($mybb->input['additionalgroups']))
{

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

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

			{

			{

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

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

Zeile 3066Zeile 3066
		{
$default_view = fetch_default_view("user");
if(!$default_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 3123Zeile 3123

$page->output_footer();
}


$page->output_footer();
}





/**
* @param array $view
*

/**
* @param array $view
*

Zeile 3210Zeile 3210

// Build header for table based view
if($view['view_type'] != "card")


// Build header for table based view
if($view['view_type'] != "card")

	{

	{

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

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

			{

			{

				continue;
}
$view_field = $user_view_fields[$field];

				continue;
}
$view_field = $user_view_fields[$field];

Zeile 3231Zeile 3231
		}
$table->construct_header("<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this);\" />"); // Create a header for the "select" boxes
}

		}
$table->construct_header("<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this);\" />"); // Create a header for the "select" boxes
}





	$search_sql = '1=1';

// Build the search SQL for users

	$search_sql = '1=1';

// Build the search SQL for users

Zeile 3239Zeile 3239
	// List of valid LIKE search fields
$user_like_fields = array("username", "email", "website", "icq", "aim", "yahoo", "skype", "google", "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", "skype", "google", "signature", "usertitle");
foreach($user_like_fields as $search_field)

	{

	{

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

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

Zeile 3324Zeile 3324
		else
{
$ip_sql = "ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);

		else
{
$ip_sql = "ipaddress BETWEEN ".$db->escape_binary($ip_range[0])." AND ".$db->escape_binary($ip_range[1]);

		}

		}

		$ip_uids = array(0);
$query = $db->simple_select("posts", "uid", $ip_sql);
while($uid = $db->fetch_field($query, "uid"))

		$ip_uids = array(0);
$query = $db->simple_select("posts", "uid", $ip_sql);
while($uid = $db->fetch_field($query, "uid"))

Zeile 3409Zeile 3409
		foreach($view['conditions']['usergroup'] as $usergroup)
{
$usergroup = (int)$usergroup;

		foreach($view['conditions']['usergroup'] as $usergroup)
{
$usergroup = (int)$usergroup;





			if(!$usergroup)
{
continue;

			if(!$usergroup)
{
continue;

Zeile 3467Zeile 3467

// Establish which page we're viewing and the starting index for querying
if(!isset($mybb->input['page']))


// Establish which page we're viewing and the starting index for querying
if(!isset($mybb->input['page']))

		{
$mybb->input['page'] = 1;

		{
$mybb->input['page'] = 1;

		}
else
{

		}
else
{

Zeile 3612Zeile 3612
					$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'] && !my_validate_url($user['avatar']))
{
$user['avatar'] = "../{$user['avatar']}";
}

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

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

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

			{
$max_dimensions = '80x80';
}

			else
{

			else
{

				$scaled_avatar = fetch_scaled_avatar($user, 34, 34);
}
if(!$user['avatar'] || (my_strpos($user['avatar'], '://') !== false && !$mybb->settings['allowremoteavatars']))
{
if(my_validate_url($mybb->settings['useravatar']))
{
$user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}
else
{
$user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}

				$max_dimensions = '34x34';












			}

			}

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





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

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


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


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

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

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

	}
else
{

	}
else
{

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

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

Zeile 3728Zeile 3716
		form.submit(function() {
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."')

		form.submit(function() {
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."')

			{

			{

				search.focus();
return false;
}

				search.focus();
return false;
}

Zeile 3742Zeile 3730
			{
searched_focus.removeClass(\"search_default\");
searched_focus.val(\"\");

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

			}

			}

		});

search.blur(function()

		});

search.blur(function()

Zeile 3754Zeile 3742
				searched_blur.val('".addcslashes($lang->search_for_user, "'")."');
}
});

				searched_blur.val('".addcslashes($lang->search_for_user, "'")."');
}
});





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

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

Zeile 3767Zeile 3755
	// TODO Select2

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

	// TODO Select2

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


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


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

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

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

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

$table->construct_row();

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

$table->construct_row();

}

/**
* @param array $user
* @param int $max_width
* @param int $max_height
*
* @return array
*/
function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{
$scaled_dimensions = array(
"width" => $max_width,
"height" => $max_height,
);

global $mybb;

if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))
{
if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";
list($width, $height) = explode("|", $user['avatardimensions']);
$scaled_dimensions = scale_image($width, $height, $max_width, $max_height);
}
}

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

 
}

/**

}

/**