Vergleich admin/modules/user/users.php - 1.4.4 - 1.4.9

  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 4272 2008-11-16 23:25:10Z belloman $

 * $Id: users.php 4389 2009-06-26 04:29:32Z RyanGordon $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 924Zeile 924
	}
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 960
		$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 1045Zeile 1045
		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");

		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");








	
if($mybb->input['pmnotice'] > 1)
{
$mybb->input['pmnotice'] = 1;
}


	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

Zeile 1193Zeile 1198
	$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


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


if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{

Zeile 1305Zeile 1310
		$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");
$db->delete_query("users", "uid='{$user['uid']}'");

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

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


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


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

Zeile 1493Zeile 1500
			$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']}'");

























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

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


			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

Zeile 1749Zeile 1776
			if(!$default_view)
{
$default_view = "0";

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

			}

			}

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

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

Zeile 1793Zeile 1820
	// 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 1808Zeile 1836
	if($view['title'])
{
$title_string = "view_title_{$view['vid']}";

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

		

		

		if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

		if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

Zeile 1823Zeile 1851
		$view['url'] = "index.php?module=user/users";
}
if(!is_array($view['conditions']))

		$view['url'] = "index.php?module=user/users";
}
if(!is_array($view['conditions']))

	{

	{

		$view['conditions'] = unserialize($view['conditions']);

		$view['conditions'] = unserialize($view['conditions']);

	}

	}

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

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

	{

	{

		$view['fields'] = unserialize($view['fields']);
}
if($mybb->input['username'])

		$view['fields'] = unserialize($view['fields']);
}
if($mybb->input['username'])

Zeile 1837Zeile 1865
	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 1861Zeile 1889
	{
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;

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

	$table = new Table;

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

Zeile 1895Zeile 1929
	// 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])."%'";
}

Zeile 1909Zeile 1943
		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])."'";

		}
}

		}
}


// LESS THAN or GREATER THAN
$direction_fields = array("postnum");


// LESS THAN or GREATER THAN
$direction_fields = array("postnum");

Zeile 1949Zeile 1983
			else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);

			else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);

				$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);

 
				if(!is_array($ip_range))
{
$ip_sql = "long{$search_field}='{$ip_range}'";

				if(!is_array($ip_range))
{
$ip_sql = "long{$search_field}='{$ip_range}'";

Zeile 1975Zeile 2008
		else
{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);

		else
{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);

			$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);

 
			if(!is_array($ip_range))

			if(!is_array($ip_range))

			{

			{

				$ip_sql = "longipaddress='{$ip_range}'";

				$ip_sql = "longipaddress='{$ip_range}'";

			}

			}

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

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

		$search_sql .= " AND EXISTS (SELECT uid FROM ".TABLE_PREFIX."posts WHERE {$ip_sql} AND uid=u.uid)";








		$ip_uids = array(0);
$query = $db->simple_select("posts", "uid", $ip_sql);
while($uid = $db->fetch_field($query, "uid"))
{
$ip_uids[] = $uid;
}
$search_sql .= " AND u.uid IN(".implode(',', $ip_uids).")";
unset($ip_uids);

	}

// Usergroup based searching

	}

// Usergroup based searching

Zeile 2170Zeile 2209
			{
$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")
{