phpBB

Code Changes

File: includes/functions_user.php

  Unmodified   Added   Modified   Removed
Line 26Line 26
* @param array &$user_id_ary The user ids to check or empty if usernames used
* @param array &$username_ary The usernames to check or empty if user ids used
* @param mixed $user_type Array of user types to check, false if not restricting by user type

* @param array &$user_id_ary The user ids to check or empty if usernames used
* @param array &$username_ary The usernames to check or empty if user ids used
* @param mixed $user_type Array of user types to check, false if not restricting by user type

 
* @param boolean $update_references If false, the supplied array is unset and appears unchanged from where it was called
* @return boolean|string Returns false on success, error string on failure

*/

*/

function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)

function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false)

{
global $db;


{
global $db;


Line 50Line 52
	}

$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});

	}

$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});

 

// By unsetting the array here, the values passed in at the point user_get_id_name() was called will be retained.
// Otherwise, if we don't unset (as the array was passed by reference) the original array will be updated below.
if ($update_references === false)
{

	unset(${$which_ary});

	unset(${$which_ary});

 
	}


$user_id_ary = $username_ary = array();



$user_id_ary = $username_ary = array();


Line 170Line 178
* Adds an user
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.

* Adds an user
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.

* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array

* @param array $cp_data custom profile fields, see custom_profile::build_insert_sql_array

* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
*/

* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
*/

Line 260Line 268
	$remaining_vars = array_diff(array_keys($user_row), array_keys($sql_ary));

// Now fill our sql array with the remaining vars

	$remaining_vars = array_diff(array_keys($user_row), array_keys($sql_ary));

// Now fill our sql array with the remaining vars

	if (sizeof($remaining_vars))

	if (count($remaining_vars))

	{
foreach ($remaining_vars as $key)
{

	{
foreach ($remaining_vars as $key)
{

Line 272Line 280
	* Use this event to modify the values to be inserted when a user is added
*
* @event core.user_add_modify_data

	* Use this event to modify the values to be inserted when a user is added
*
* @event core.user_add_modify_data

	* @var array	user_row		Array of user details submited to user_add
* @var array cp_data Array of Custom profile fields submited to user_add
* @var array sql_ary Array of data to be inserted when a user is added


	* @var array	user_row			Array of user details submitted to user_add
* @var array cp_data Array of Custom profile fields submitted to user_add
* @var array sql_ary Array of data to be inserted when a user is added
* @var array notifications_data Array of notification data to be inserted when a user is added

	* @since 3.1.0-a1

	* @since 3.1.0-a1

	* @change 3.1.0-b5


	* @changed 3.1.0-b5 Added user_row and cp_data
* @changed 3.1.11-RC1 Added notifications_data

	*/

	*/

	$vars = array('user_row', 'cp_data', 'sql_ary');

	$vars = array('user_row', 'cp_data', 'sql_ary', 'notifications_data');

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

$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);

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

$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);

Line 287Line 297
	$user_id = $db->sql_nextid();

// Insert Custom Profile Fields

	$user_id = $db->sql_nextid();

// Insert Custom Profile Fields

	if ($cp_data !== false && sizeof($cp_data))

	if ($cp_data !== false && count($cp_data))

	{
$cp_data['user_id'] = (int) $user_id;


	{
$cp_data['user_id'] = (int) $user_id;


Line 373Line 383
			),
);
}

			),
);
}

 

/**
* Modify the notifications data to be inserted in the database when a user is added
*
* @event core.user_add_modify_notifications_data
* @var array user_row Array of user details submitted to user_add
* @var array cp_data Array of Custom profile fields submitted to user_add
* @var array sql_ary Array of data to be inserted when a user is added
* @var array notifications_data Array of notification data to be inserted when a user is added
* @since 3.2.2-RC1
*/
$vars = array('user_row', 'cp_data', 'sql_ary', 'notifications_data');
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_notifications_data', compact($vars)));


// Subscribe user to notifications if necessary
if (!empty($notifications_data))


// Subscribe user to notifications if necessary
if (!empty($notifications_data))

Line 386Line 409
	}

/**

	}

/**

	* Event that returns user id, user detals and user CPF of newly registared user

	* Event that returns user id, user details and user CPF of newly registered user

	*
* @event core.user_add_after

	*
* @event core.user_add_after

	* @var int		user_id			User id of newly registared user
* @var array user_row Array of user details submited to user_add
* @var array cp_data Array of Custom profile fields submited to user_add

	* @var int		user_id			User id of newly registered user
* @var array user_row Array of user details submitted to user_add
* @var array cp_data Array of Custom profile fields submitted to user_add

	* @since 3.1.0-b5
*/
$vars = array('user_id', 'user_row', 'cp_data');

	* @since 3.1.0-b5
*/
$vars = array('user_id', 'user_row', 'cp_data');

Line 446Line 469
	* @var	array	user_ids	IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not

	* @var	array	user_ids	IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not

 
	* @var	array	user_rows	Array containing data of the deleted users

	* @since 3.1.0-a1

	* @since 3.1.0-a1

 
	* @changed 3.2.4-RC1 Added user_rows

	*/

	*/

	$vars = array('mode', 'user_ids', 'retain_username');

	$vars = array('mode', 'user_ids', 'retain_username', 'user_rows');

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

// Before we begin, we will remove the reports the user issued.

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

// Before we begin, we will remove the reports the user issued.

Line 466Line 491
	}
$db->sql_freeresult($result);


	}
$db->sql_freeresult($result);


	if (sizeof($report_posts))

	if (count($report_posts))

	{
$report_posts = array_unique($report_posts);
$report_topics = array_unique($report_topics);

	{
$report_posts = array_unique($report_posts);
$report_topics = array_unique($report_topics);

Line 486Line 511
		}
$db->sql_freeresult($result);


		}
$db->sql_freeresult($result);


		if (sizeof($keep_report_topics))

		if (count($keep_report_topics))

		{
$report_topics = array_diff($report_topics, $keep_report_topics);
}

		{
$report_topics = array_diff($report_topics, $keep_report_topics);
}

Line 498Line 523
			WHERE ' . $db->sql_in_set('post_id', $report_posts);
$db->sql_query($sql);


			WHERE ' . $db->sql_in_set('post_id', $report_posts);
$db->sql_query($sql);


		if (sizeof($report_topics))

		if (count($report_topics))

		{
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_reported = 0

		{
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_reported = 0

Line 649Line 674
		delete_posts('poster_id', $user_ids);
}


		delete_posts('poster_id', $user_ids);
}


	$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);





















	$table_ary = [
USERS_TABLE,
USER_GROUP_TABLE,
TOPICS_WATCH_TABLE,
FORUMS_WATCH_TABLE,
ACL_USERS_TABLE,
TOPICS_TRACK_TABLE,
TOPICS_POSTED_TABLE,
FORUMS_TRACK_TABLE,
PROFILE_FIELDS_DATA_TABLE,
MODERATOR_CACHE_TABLE,
DRAFTS_TABLE,
BOOKMARKS_TABLE,
SESSIONS_KEYS_TABLE,
PRIVMSGS_FOLDER_TABLE,
PRIVMSGS_RULES_TABLE,
$phpbb_container->getParameter('tables.auth_provider_oauth_token_storage'),
$phpbb_container->getParameter('tables.auth_provider_oauth_states'),
$phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc'),
$phpbb_container->getParameter('tables.user_notifications')
];





 
	// Ignore errors on deleting from non-existent tables, e.g. when migrating
$db->sql_return_on_error(true);

	// Delete the miscellaneous (non-post) data for the user
foreach ($table_ary as $table)
{

	// Delete the miscellaneous (non-post) data for the user
foreach ($table_ary as $table)
{

Line 658Line 705
			WHERE " . $user_id_sql;
$db->sql_query($sql);
}

			WHERE " . $user_id_sql;
$db->sql_query($sql);
}

 
	$db->sql_return_on_error();


$cache->destroy('sql', MODERATOR_CACHE_TABLE);



$cache->destroy('sql', MODERATOR_CACHE_TABLE);


Line 732Line 780
	* @var	array	user_ids	IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not

	* @var	array	user_ids	IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not

 
	* @var	array	user_rows	Array containing data of the deleted users

	* @since 3.1.0-a1

	* @since 3.1.0-a1

 
	* @changed 3.2.2-RC1 Added user_rows

	*/

	*/

	$vars = array('mode', 'user_ids', 'retain_username');

	$vars = array('mode', 'user_ids', 'retain_username', 'user_rows');

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

// Reset newest user info if appropriate

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

// Reset newest user info if appropriate

Line 763Line 813
		$user_id_ary = array($user_id_ary);
}


		$user_id_ary = array($user_id_ary);
}


	if (!sizeof($user_id_ary))

	if (!count($user_id_ary))

	{
return;
}

	{
return;
}

Line 821Line 871
	$vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));


	$vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));


	if (sizeof($sql_statements))

	if (count($sql_statements))

	{
foreach ($sql_statements as $user_id => $sql_ary)
{

	{
foreach ($sql_statements as $user_id => $sql_ary)
{

Line 899Line 949
		else
{
$ban_other = explode('-', $ban_len_other);

		else
{
$ban_other = explode('-', $ban_len_other);

			if (sizeof($ban_other) == 3 && ((int) $ban_other[0] < 9999) &&

			if (count($ban_other) == 3 && ((int) $ban_other[0] < 9999) &&

				(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
{
$ban_end = max($current_time, $user->create_datetime()

				(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
{
$ban_end = max($current_time, $user->create_datetime()

Line 967Line 1017
			}

// Make sure we have been given someone to ban

			}

// Make sure we have been given someone to ban

			if (!sizeof($sql_usernames))

			if (!count($sql_usernames))

			{
trigger_error('NO_USER_SPECIFIED', E_USER_WARNING);
}

			{
trigger_error('NO_USER_SPECIFIED', E_USER_WARNING);
}

Line 978Line 1028

// Do not allow banning yourself, the guest account, or founders.
$non_bannable = array($user->data['user_id'], ANONYMOUS);


// Do not allow banning yourself, the guest account, or founders.
$non_bannable = array($user->data['user_id'], ANONYMOUS);

			if (sizeof($founder))

			if (count($founder))

			{
$sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true);
}

			{
$sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true);
}

Line 1118Line 1168
						continue;
}


						continue;
}


					if (!sizeof($founder) || !in_array($ban_item, $founder))

					if (!count($founder) || !in_array($ban_item, $founder))

					{
$banlist_ary[] = $ban_item;
}
}
}


					{
$banlist_ary[] = $ban_item;
}
}
}


			if (sizeof($ban_list) == 0)

			if (count($ban_list) == 0)

			{
trigger_error('NO_EMAILS_DEFINED', E_USER_WARNING);
}

			{
trigger_error('NO_EMAILS_DEFINED', E_USER_WARNING);
}

Line 1172Line 1222

$banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp);



$banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp);


		if (sizeof($banlist_ary_tmp))

		if (count($banlist_ary_tmp))

		{
// One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length
$sql = 'DELETE FROM ' . BANLIST_TABLE . '

		{
// One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length
$sql = 'DELETE FROM ' . BANLIST_TABLE . '

Line 1186Line 1236
	$db->sql_freeresult($result);

// We have some entities to ban

	$db->sql_freeresult($result);

// We have some entities to ban

	if (sizeof($banlist_ary))

	if (count($banlist_ary))

	{
$sql_ary = array();


	{
$sql_ary = array();


Line 1314Line 1364

$unban_sql = array_map('intval', $ban);



$unban_sql = array_map('intval', $ban);


	if (sizeof($unban_sql))

	if (count($unban_sql))

	{
// Grab details of bans for logging information later
switch ($mode)

	{
// Grab details of bans for logging information later
switch ($mode)

Line 1410Line 1460
		return '';
}


		return '';
}


	if (preg_match(get_preg_expression('ipv4'), $ip))
{
// IPv4 address
$whois_host = 'whois.arin.net.';
}
else if (preg_match(get_preg_expression('ipv6'), $ip))
{
// IPv6 address
$whois_host = 'whois.sixxs.net.';
}
else

	if (!preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))











	{
return '';
}

	{
return '';
}

 

// IPv4 & IPv6 addresses
$whois_host = 'whois.arin.net.';


$ipwhois = '';



$ipwhois = '';


Line 1578Line 1621
function validate_date($date_string, $optional = false)
{
$date = explode('-', $date_string);

function validate_date($date_string, $optional = false)
{
$date = explode('-', $date_string);

	if ((empty($date) || sizeof($date) != 3) && $optional)

	if ((empty($date) || count($date) != 3) && $optional)

	{
return false;
}

	{
return false;
}

Line 1600Line 1643
		}
}


		}
}


	if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2]))

	if (count($date) != 3 || !checkdate($date[1], $date[0], $date[2]))

	{
return 'INVALID';
}

	{
return 'INVALID';
}

Line 1675Line 1718
	return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID';
}


	return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID';
}


/**



/***
* Validate Username
*

* Check to see if the username has been taken, or if it is disallowed.

* Check to see if the username has been taken, or if it is disallowed.

* Also checks if it includes the " character, which we don't allow in usernames.


 * Also checks if it includes the " character or the 4-bytes Unicode ones
* (aka emojis) which we don't allow in usernames.

* Used for registering, changing names, and posting anonymously with a username
*

* Used for registering, changing names, and posting anonymously with a username
*

* @param string $username The username to check
* @param string $allowed_username An allowed username, default being $user->data['username']

 * @param string	$username				The username to check
* @param string $allowed_username An allowed username, default being $user->data['username']

*

*

* @return	mixed	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)


 * @return mixed							Either false if validation succeeded or a string which will be
* used as the error message (with the variable name appended)

*/

*/

function validate_username($username, $allowed_username = false)

function validate_username($username, $allowed_username = false, $allow_all_names = false)

{
global $config, $db, $user, $cache;


{
global $config, $db, $user, $cache;


Line 1695Line 1742
	if ($allowed_username == $clean_username)
{
return false;

	if ($allowed_username == $clean_username)
{
return false;

 
	}

// The very first check is for
// out-of-bounds characters that are currently
// not supported by utf8_bin in MySQL
if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $username))
{
return 'INVALID_EMOJIS';

	}

// ... fast checks first.

	}

// ... fast checks first.

Line 1760Line 1815
		return 'USERNAME_TAKEN';
}


		return 'USERNAME_TAKEN';
}


 
	if (!$allow_all_names)
{

	$bad_usernames = $cache->obtain_disallowed_usernames();

foreach ($bad_usernames as $bad_username)

	$bad_usernames = $cache->obtain_disallowed_usernames();

foreach ($bad_usernames as $bad_username)

Line 1767Line 1824
		if (preg_match('#^' . $bad_username . '$#', $clean_username))
{
return 'USERNAME_DISALLOWED';

		if (preg_match('#^' . $bad_username . '$#', $clean_username))
{
return 'USERNAME_DISALLOWED';

 
			}

		}
}


		}
}


Line 1887Line 1945
		return $validate_email;
}


		return $validate_email;
}


	if (($ban_reason = $user->check_ban(false, false, $email, true)) !== false)


	$ban = $user->check_ban(false, false, $email, true);
if (!empty($ban))

	{

	{

		return ($ban_reason === true) ? 'EMAIL_BANNED' : $ban_reason;

		return !empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : 'EMAIL_BANNED';

	}

if (!$config['allow_emailreuse'])

	}

if (!$config['allow_emailreuse'])

Line 1940Line 1999

$arr = explode('.', $realm);



$arr = explode('.', $realm);


	if (sizeof($arr) == 0)

	if (count($arr) == 0)

	{
return 'WRONG_DATA';
}

	{
return 'WRONG_DATA';
}

Line 2264Line 2323
	$group_teampage = !empty($group_attributes['group_teampage']);
unset($group_attributes['group_teampage']);


	$group_teampage = !empty($group_attributes['group_teampage']);
unset($group_attributes['group_teampage']);


	if (!sizeof($error))

	if (!count($error))

	{
$current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
$current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;

	{
$current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
$current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;

Line 2337Line 2396
			generate_text_for_storage($sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies);
}


			generate_text_for_storage($sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies);
}


		if (sizeof($group_attributes))

		if (count($group_attributes))

		{
// Merge them with $sql_ary to properly update the group
$sql_ary = array_merge($sql_ary, $group_attributes);

		{
// Merge them with $sql_ary to properly update the group
$sql_ary = array_merge($sql_ary, $group_attributes);

Line 2463Line 2522

// Set user attributes
$sql_ary = array();


// Set user attributes
$sql_ary = array();

		if (sizeof($group_attributes))

		if (count($group_attributes))

		{
// Go through the user attributes array, check if a group attribute matches it and then set it. ;)
foreach ($user_attribute_ary as $attribute)

		{
// Go through the user attributes array, check if a group attribute matches it and then set it. ;)
foreach ($user_attribute_ary as $attribute)

Line 2483Line 2542
			}
}


			}
}


		if (sizeof($sql_ary) && sizeof($user_ary))

		if (count($sql_ary) && count($user_ary))

		{
group_set_user_default($group_id, $user_ary, $sql_ary);
}

		{
group_set_user_default($group_id, $user_ary, $sql_ary);
}

Line 2494Line 2553
		group_update_listings($group_id);
}


		group_update_listings($group_id);
}


	return (sizeof($error)) ? $error : false;

	return (count($error)) ? $error : false;

}



}



Line 2659Line 2718
	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	if (!sizeof($user_id_ary) || $result !== false)

	if (empty($user_id_ary) || $result !== false)

	{
return 'NO_USER';

	{
return 'NO_USER';

 
	}

// Because the item that gets passed into the previous function is unset, the reference is lost and our original
// array is retained - so we know there's a problem if there's a different number of ids to usernames now.
if (count($user_id_ary) != count($username_ary))
{
return 'GROUP_USERS_INVALID';

	}

// Remove users who are already members of this group

	}

// Remove users who are already members of this group

Line 2687Line 2753
	$add_id_ary = array_diff($user_id_ary, $add_id_ary);

// If we have no users

	$add_id_ary = array_diff($user_id_ary, $add_id_ary);

// If we have no users

	if (!sizeof($add_id_ary) && !sizeof($update_id_ary))

	if (!count($add_id_ary) && !count($update_id_ary))

	{
return 'GROUP_USERS_EXIST';
}

	{
return 'GROUP_USERS_EXIST';
}

Line 2695Line 2761
	$db->sql_transaction('begin');

// Insert the new users

	$db->sql_transaction('begin');

// Insert the new users

	if (sizeof($add_id_ary))

	if (count($add_id_ary))

	{
$sql_ary = array();


	{
$sql_ary = array();


Line 2712Line 2778
		$db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary);
}


		$db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary);
}


	if (sizeof($update_id_ary))

	if (count($update_id_ary))

	{
$sql = 'UPDATE ' . USER_GROUP_TABLE . '
SET group_leader = 1

	{
$sql = 'UPDATE ' . USER_GROUP_TABLE . '
SET group_leader = 1

Line 2804Line 2870
	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	if (!sizeof($user_id_ary) || $result !== false)

	if (empty($user_id_ary) || $result !== false)

	{
return 'NO_USER';
}

	{
return 'NO_USER';
}

Line 2880Line 2946

foreach ($special_group_data as $gid => $default_data_ary)
{


foreach ($special_group_data as $gid => $default_data_ary)
{

		if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid]))

		if (isset($sql_where_ary[$gid]) && count($sql_where_ary[$gid]))

		{
remove_default_rank($group_id, $sql_where_ary[$gid]);
remove_default_avatar($group_id, $sql_where_ary[$gid]);

		{
remove_default_rank($group_id, $sql_where_ary[$gid]);
remove_default_avatar($group_id, $sql_where_ary[$gid]);

Line 3039Line 3105
	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);


	if (!sizeof($user_id_ary) || $result !== false)

	if (empty($user_id_ary) || $result !== false)

	{
return 'NO_USERS';
}

	{
return 'NO_USERS';
}

Line 3094Line 3160
			}
$db->sql_freeresult($result);


			}
$db->sql_freeresult($result);


			if (!sizeof($user_id_ary))

			if (!count($user_id_ary))

			{
return false;
}

			{
return false;
}

Line 3135Line 3201
			$db->sql_freeresult($result);

$result = user_get_id_name($user_id_ary, $username_ary);

			$db->sql_freeresult($result);

$result = user_get_id_name($user_id_ary, $username_ary);

			if (!sizeof($user_id_ary) || $result !== false)

			if (!count($user_id_ary) || $result !== false)

			{
return 'NO_USERS';
}

			{
return 'NO_USERS';
}

Line 3498Line 3564

$hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_'));



$hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_'));


	if (!sizeof($hold_ary))

	if (empty($hold_ary))

	{
return;
}

	{
return;
}

Line 3583Line 3649
		{
$user_data = $user_row;
}

		{
$user_data = $user_row;
}

	}

if (empty($user_data['user_new']))
{
return false;

 
	}

$sql = 'SELECT group_id

	}

$sql = 'SELECT group_id