phpBB

Code Changes

File: includes/acp/acp_groups.php

  Unmodified   Added   Modified   Removed
Line 28Line 28
		global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_container, $phpbb_dispatcher;

		global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_container, $phpbb_dispatcher;

 

/** @var \phpbb\language\language $language Language object */
$language = $phpbb_container->get('language');


$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';


$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';

Line 187Line 190

group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);



group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);


							$start = (sizeof($mark_ary) < 200) ? 0 : $start + 200;

							$start = (count($mark_ary) < 200) ? 0 : $start + 200;

						}
else
{

						}
else
{

Line 293Line 296
				// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{

				// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{

					trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);













					$display_message = $language->lang($error);

if ($error == 'GROUP_USERS_INVALID')
{
// Find which users don't exist
$actual_name_ary = $name_ary;
$actual_user_id_ary = [];
user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);

$display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp')));
}

trigger_error($display_message . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);

				}

$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';

				}

$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';

Line 486Line 501
						$error = array_merge($error, $validation_error);
}


						$error = array_merge($error, $validation_error);
}


					if (!sizeof($error))

					if (!count($error))

					{
// Only set the rank, colour, etc. if it's changed or if we're adding a new
// group. This prevents existing group members being updated if no changes

					{
// Only set the rank, colour, etc. if it's changed or if we're adding a new
// group. This prevents existing group members being updated if no changes

Line 614Line 629
						}
}


						}
}


					if (sizeof($error))

					if (count($error))

					{
$error = array_map(array(&$user, 'lang'), $error);
$group_rank = $submit_ary['rank'];

					{
$error = array_map(array(&$user, 'lang'), $error);
$group_rank = $submit_ary['rank'];

Line 732Line 747
					'S_ADD_GROUP'		=> ($action == 'add') ? true : false,
'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false,
'S_INCLUDE_SWATCH' => true,

					'S_ADD_GROUP'		=> ($action == 'add') ? true : false,
'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false,
'S_INCLUDE_SWATCH' => true,

					'S_ERROR'			=> (sizeof($error)) ? true : false,

					'S_ERROR'			=> (count($error)) ? true : false,

					'S_SPECIAL_GROUP'	=> ($group_type == GROUP_SPECIAL) ? true : false,
'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),


					'S_SPECIAL_GROUP'	=> ($group_type == GROUP_SPECIAL) ? true : false,
'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),


					'ERROR_MSG'				=> (sizeof($error)) ? implode('<br />', $error) : '',

					'ERROR_MSG'				=> (count($error)) ? implode('<br />', $error) : '',

					'GROUP_NAME'			=> $group_helper->get_name($group_name),
'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_DESC' => $group_desc_data['text'],

					'GROUP_NAME'			=> $group_helper->get_name($group_name),
'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_DESC' => $group_desc_data['text'],

Line 926Line 941
		);

// Get us all the groups

		);

// Get us all the groups

		$sql = 'SELECT g.group_id, g.group_name, g.group_type

		$sql = 'SELECT g.group_id, g.group_name, g.group_type, g.group_colour

			FROM ' . GROUPS_TABLE . ' g
ORDER BY g.group_type ASC, g.group_name';
$result = $db->sql_query($sql);

			FROM ' . GROUPS_TABLE . ' g
ORDER BY g.group_type ASC, g.group_name';
$result = $db->sql_query($sql);

Line 985Line 1000
					'S_GROUP_SPECIAL'	=> ($row['group_type'] == GROUP_SPECIAL) ? true : false,

'GROUP_NAME' => $group_name,

					'S_GROUP_SPECIAL'	=> ($row['group_type'] == GROUP_SPECIAL) ? true : false,

'GROUP_NAME' => $group_name,

 
					'GROUP_COLOR'	=> $row['group_colour'],

					'TOTAL_MEMBERS'	=> $row['total_members'],
'PENDING_MEMBERS' => $row['pending_members']
));

					'TOTAL_MEMBERS'	=> $row['total_members'],
'PENDING_MEMBERS' => $row['pending_members']
));