phpBB

Code Changes

File: memberlist.php

  Unmodified   Added   Modified   Removed
Line 20Line 20
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);


include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);


$mode = request_var('mode', '');

$mode = $request->variable('mode', '');


if ($mode === 'contactadmin')
{


if ($mode === 'contactadmin')
{

Line 37Line 37
$template->assign_var('S_IN_MEMBERLIST', true);

// Grab data

$template->assign_var('S_IN_MEMBERLIST', true);

// Grab data

$action		= request_var('action', '');
$user_id = request_var('u', ANONYMOUS);
$username = request_var('un', '', true);
$group_id = request_var('g', 0);
$topic_id = request_var('t', 0);

$action		= $request->variable('action', '');
$user_id = $request->variable('u', ANONYMOUS);
$username = $request->variable('un', '', true);
$group_id = $request->variable('g', 0);
$topic_id = $request->variable('t', 0);


// Redirect when old mode is used
if ($mode == 'leaders')


// Redirect when old mode is used
if ($mode == 'leaders')

Line 75Line 75
		{
if ($user->data['user_id'] != ANONYMOUS)
{

		{
if ($user->data['user_id'] != ANONYMOUS)
{

 
				send_status_line(403, 'Forbidden');

				trigger_error('NO_VIEW_USERS');
}


				trigger_error('NO_VIEW_USERS');
}


Line 83Line 84
	break;
}


	break;
}


$start	= request_var('start', 0);




/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');

$start = $request->variable('start', 0);

$submit = (isset($_POST['submit'])) ? true : false;

$default_key = 'c';

$submit = (isset($_POST['submit'])) ? true : false;

$default_key = 'c';

$sort_key = request_var('sk', $default_key);
$sort_dir = request_var('sd', 'a');







$sort_key = $request->variable('sk', $default_key);
$sort_dir = $request->variable('sd', 'a');

$user_types = array(USER_NORMAL, USER_FOUNDER);
if ($auth->acl_get('a_user'))
{
$user_types[] = USER_INACTIVE;
}


// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)


// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)

Line 136Line 146
			}
else
{

			}
else
{

				$row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];

				$row['group_name'] = $group_helper->get_name($row['group_name']);

				$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}


				$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}


Line 363Line 373

if (!$auth->acl_get('u_sendim'))
{


if (!$auth->acl_get('u_sendim'))
{

 
			send_status_line(403, 'Forbidden');

			trigger_error('NOT_AUTHORISED');
}


			trigger_error('NOT_AUTHORISED');
}


Line 413Line 424
						include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);

						include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);

						$message = utf8_normalize_nfc(request_var('message', '', true));

						$message = $request->variable('message', '', true);


if (empty($message))
{


if (empty($message))
{

Line 538Line 549
		$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{

		$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{

			if ($row['group_type'] == GROUP_SPECIAL)
{
// Lookup group name in language dictionary
if (isset($user->lang['G_' . $row['group_name']]))
{
$row['group_name'] = $user->lang['G_' . $row['group_name']];
}
}
else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))

			if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))









			{
// Skip over hidden groups the user cannot see
continue;
}

			{
// Skip over hidden groups the user cannot see
continue;
}

 

$row['group_name'] = $group_helper->get_name($row['group_name']);


$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;


$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;

Line 640Line 645
		$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{

		$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{

 
			/* @var $cp \phpbb\profilefields\manager */

			$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();

			$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();

Line 788Line 794
			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


		$user_id	= request_var('u', 0);
$topic_id = request_var('t', 0);

		$user_id	= $request->variable('u', 0);
$topic_id = $request->variable('t', 0);


if ($user_id)
{


if ($user_id)
{

Line 807Line 813
		{
trigger_error('NO_EMAIL');
}

		{
trigger_error('NO_EMAIL');
}

 

/** @var $form \phpbb\message\form */

		$form = $phpbb_container->get('message.form.' . $form_name);

$form->bind($request);

		$form = $phpbb_container->get('message.form.' . $form_name);

$form->bind($request);

Line 834Line 842

$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '


$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '

			WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '

			WHERE ' . $db->sql_in_set('user_type', $user_types) . '

				AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();

				AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();

Line 862Line 870
		// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';

		// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';

 

/* @var $pagination \phpbb\pagination */

		$pagination = $phpbb_container->get('pagination');

// Sorting

		$pagination = $phpbb_container->get('pagination');

// Sorting

Line 910Line 920
		$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';



		$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';



		$form			= request_var('form', '');
$field = request_var('field', '');
$select_single = request_var('select_single', false);

		$form			= $request->variable('form', '');
$field = $request->variable('field', '');
$select_single = $request->variable('select_single', false);


// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');


// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');

Line 922Line 932
		$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{

		$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{

			$username	= request_var('username', '', true);
$email = strtolower(request_var('email', ''));
$jabber = request_var('jabber', '');
$search_group_id = request_var('search_group_id', 0);

			$username	= $request->variable('username', '', true);
$email = strtolower($request->variable('email', ''));
$jabber = $request->variable('jabber', '');
$search_group_id = $request->variable('search_group_id', 0);


// when using these, make sure that we actually have values defined in $find_key_match


// when using these, make sure that we actually have values defined in $find_key_match

			$joined_select	= request_var('joined_select', 'lt');
$active_select = request_var('active_select', 'lt');
$count_select = request_var('count_select', 'eq');

			$joined_select	= $request->variable('joined_select', 'lt');
$active_select = $request->variable('active_select', 'lt');
$count_select = $request->variable('count_select', 'eq');





			$joined			= explode('-', request_var('joined', ''));
$active = explode('-', request_var('active', ''));
$count = (request_var('count', '') !== '') ? request_var('count', 0) : '';
$ipdomain = request_var('ip', '');

			$joined			= explode('-', $request->variable('joined', ''));
$active = explode('-', $request->variable('active', ''));
$count = ($request->variable('count', '') !== '') ? $request->variable('count', 0) : '';
$ipdomain = $request->variable('ip', '');


$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');



$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');


Line 1069Line 1079
			}
}


			}
}


		$first_char = request_var('first_char', '');

		$first_char = $request->variable('first_char', '');


if ($first_char == 'other')
{


if ($first_char == 'other')
{

Line 1168Line 1178

$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),


$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),

				'GROUP_NAME'	=> ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],

				'GROUP_NAME'	=> $group_helper->get_name($group_row['group_name']),

				'GROUP_COLOR'	=> $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],

				'GROUP_COLOR'	=> $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],

Line 1229Line 1239
		);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));


		);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));


		$user_types = array(USER_NORMAL, USER_FOUNDER);
if ($auth->acl_get('a_user'))
{
$user_types[] = USER_INACTIVE;
}

 
		// Count the users ...
$sql = 'SELECT COUNT(u.user_id) AS total_users
FROM ' . USERS_TABLE . " u$sql_from

		// Count the users ...
$sql = 'SELECT COUNT(u.user_id) AS total_users
FROM ' . USERS_TABLE . " u$sql_from

Line 1246Line 1251
		// Build a relevant pagination_url
$params = $sort_params = array();


		// Build a relevant pagination_url
$params = $sort_params = array();


		// We do not use request_var() here directly to save some calls (not all variables are set)

		// We do not use $request->variable() here directly to save some calls (not all variables are set)

		$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),

		$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),

Line 1263Line 1268
			'count_select'	=> array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),

			'count_select'	=> array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),

			'count'			=> (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),

			'count'			=> ($request->variable('count', '') !== '') ? array('count', 0) : array('count', ''),

			'ip'			=> array('ip', ''),
'first_char' => array('first_char', ''),
);

			'ip'			=> array('ip', ''),
'first_char' => array('first_char', ''),
);

Line 1276Line 1281
				continue;
}


				continue;
}


			$param = call_user_func_array('request_var', $call);
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);


			$param = call_user_func_array(array($request, 'variable'), $call);
// Encode strings, convert everything else to int in order to prevent empty parameters.
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : (int) $param);

			$params[] = $param;

if ($key != 'first_char')

			$params[] = $param;

if ($key != 'first_char')

Line 1328Line 1334
		// Some search user specific data
if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{

		// Some search user specific data
if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{

			$group_selected = request_var('search_group_id', 0);

			$group_selected = $request->variable('search_group_id', 0);

			$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
$group_ids = array();


			$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
$group_ids = array();


Line 1372Line 1378
			while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];

			while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];

				$s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';

				$s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . $group_helper->get_name($row['group_name']) . '</option>';

			}
$db->sql_freeresult($result);


			}
$db->sql_freeresult($result);


Line 1428Line 1434
		// Load custom profile fields
if ($config['load_cpf_memberlist'])
{

		// Load custom profile fields
if ($config['load_cpf_memberlist'])
{

 
			/* @var $cp \phpbb\profilefields\manager */

			$cp = $phpbb_container->get('profilefields.manager');

$cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');

			$cp = $phpbb_container->get('profilefields.manager');

$cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');