Vergleich admin/modules/user/users.php - 1.4.0 - 1.4.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * 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 4054 2008-07-31 05:19:05Z Tikitiki $

 * $Id: users.php 4111 2008-08-13 06:14:12Z Tikitiki $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 977Zeile 977
	{
$options[$usergroup['gid']] = $usergroup['title'];
$display_group_options[$usergroup['gid']] = $usergroup['title'];

	{
$options[$usergroup['gid']] = $usergroup['title'];
$display_group_options[$usergroup['gid']] = $usergroup['title'];

 
	}

if(!is_array($mybb->input['additionalgroups']))
{
$mybb->input['additionalgroups'] = explode(',', $mybb->input['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->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');

Zeile 1043Zeile 1048
	$date_options = array(
"<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->input['dateformat'], array('id' => 'dateformat')),
"<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->input['timeformat'], array('id' => 'timeformat')),

	$date_options = array(
"<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->input['dateformat'], array('id' => 'dateformat')),
"<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->input['timeformat'], array('id' => 'timeformat')),

		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->user['timezone']),

		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->input['timezone']),

		"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");

		"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");

Zeile 1361Zeile 1366
	else
{
$popup = new PopupMenu("user_last", $lang->options);

	else
{
$popup = new PopupMenu("user_last", $lang->options);

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$user['lastip']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$user['lastip']}");


		$popup->add_item($lang->show_users_regged_with_ip, 
"index.php?module=user/users&amp;action=search&amp;results=1&amp;conditions=".urlencode(serialize(array("regip" => $user['lastip']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $user['lastip']))));

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['lastip']}");
$controls = $popup->fetch();
}

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['lastip']}");
$controls = $popup->fetch();
}

Zeile 1378Zeile 1384
	else
{
$popup = new PopupMenu("user_reg", $lang->options);

	else
{
$popup = new PopupMenu("user_reg", $lang->options);

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$user['regip']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$user['regip']}");

		$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("regip" => $user['regip']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $user['regip']))));

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();
}

		$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$user['regip']}");
$controls = $popup->fetch();
}

Zeile 1393Zeile 1399
		if(!$done_ip[$ip['ipaddress']])
{
$popup = new PopupMenu("post_{$ip['pid']}", $lang->options);

		if(!$done_ip[$ip['ipaddress']])
{
$popup = new PopupMenu("post_{$ip['pid']}", $lang->options);

			$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;action=search&amp;regip={$ip['ipaddress']}");
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;action=search&amp;postip={$ip['ipaddress']}");

			$popup->add_item($lang->show_users_regged_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("regip" => $ip['ipaddress']))));
$popup->add_item($lang->show_users_posted_with_ip, "index.php?module=user/users&amp;results=1&amp;action=search&amp;conditions=".urlencode(serialize(array("postip" => $ip['ipaddress']))));

			$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();


			$popup->add_item($lang->ban_ip, "index.php?module=config/banning&amp;filter={$ip['ipaddress']}");
$controls = $popup->fetch();


Zeile 1581Zeile 1587
		}

// Override specific parts of the view

		}

// Override specific parts of the view

		unset($admin_view['vid']);


		unset($admin_view['vid']);


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

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

		{

		{

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

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

		}

		}

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

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

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

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

		}


		}


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

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

		{

		{

			$admin_view['perpage'] = $mybb->input['perpage'];

			$admin_view['perpage'] = $mybb->input['perpage'];

		}

		}

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

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

Zeile 1611Zeile 1617
		if($mybb->input['displayas'])
{
$admin_view['view_type'] = $mybb->input['displayas'];

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

		}


		}


		$results = build_users_view($admin_view);

if($results)

		$results = build_users_view($admin_view);

if($results)

		{

		{

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

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

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

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

		}
}

		}
}


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


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

Zeile 1672Zeile 1678
	
$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>";

	

	

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

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

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

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

Zeile 1700Zeile 1706
			$default_view = fetch_default_view("user");
$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);

			$default_view = fetch_default_view("user");
$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);

		}
}

		}
}


// Fetch a list of all of the views for this user
$popup = new PopupMenu("views", $lang->views);


// Fetch a list of all of the views for this user
$popup = new PopupMenu("views", $lang->views);

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

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

	}

echo $results;

	}

echo $results;


$page->output_footer();
}


$page->output_footer();
}

Zeile 1746Zeile 1752
		$title_string = "view_title_{$view['vid']}";

if($lang->$title_string)

		$title_string = "view_title_{$view['vid']}";

if($lang->$title_string)

		{

		{

			$view['title'] = $lang->$title_string;
}


			$view['title'] = $lang->$title_string;
}


Zeile 1761Zeile 1767
	if(!is_array($view['conditions']))
{
$view['conditions'] = unserialize($view['conditions']);

	if(!is_array($view['conditions']))
{
$view['conditions'] = unserialize($view['conditions']);

	}

	}

	if(!is_array($view['fields']))
{
$view['fields'] = unserialize($view['fields']);

	if(!is_array($view['fields']))
{
$view['fields'] = unserialize($view['fields']);

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

	}

	}

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





	$table = new Table;

// Build header for table based view

	$table = new Table;

// Build header for table based view

Zeile 1806Zeile 1812
		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];
$field_options = array();
if($view_field['width'])

				continue;
}
$view_field = $user_view_fields[$field];
$field_options = array();
if($view_field['width'])

			{

			{

				$field_options['width'] = $view_field['width'];

				$field_options['width'] = $view_field['width'];

			}

			}

			if($view_field['align'])
{
$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

			if($view_field['align'])
{
$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

		}
}


$search_sql = '1=1';

		}
}


$search_sql = '1=1';


// Build the search SQL for users



// Build the search SQL for users


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

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


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

Zeile 1851Zeile 1857
	// LESS THAN or GREATER THAN
$direction_fields = array("postnum");
foreach($direction_fields as $search_field)

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

	{

	{

		$direction_field = $search_field."_dir";

		$direction_field = $search_field."_dir";

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

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

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

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

Zeile 1867Zeile 1873
					$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])."'";

		}

		}

	}

// IP searching

	}

// IP searching

Zeile 1882Zeile 1888
			if(strpos($view['conditions'][$search_field], ":") !== false)
{
$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";

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

			}

			}

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

			else
{
$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}'";
}
else

Zeile 1896Zeile 1902
				}
}
$search_sql .= " AND {$ip_sql}";

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

		}
}

		}
}


// Usergroup based searching
if($view['conditions']['usergroup'])


// Usergroup based searching
if($view['conditions']['usergroup'])

Zeile 1926Zeile 1932
	if($view['conditions']['coppa'])
{
$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";

	if($view['conditions']['coppa'])
{
$search_sql .= " AND u.coppauser=1 AND u.usergroup=5";

	}


	}


	// Extra SQL?
if($view['extra_sql'])
{

	// Extra SQL?
if($view['extra_sql'])
{

Zeile 1941Zeile 1947
		WHERE {$search_sql}
");
$num_results = $db->fetch_field($query, "num_results");

		WHERE {$search_sql}
");
$num_results = $db->fetch_field($query, "num_results");



	

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

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