mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
git-svn-id: file:///svn/phpbb/trunk@8635 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
8f3c085f7f
commit
d7a217c28c
3 changed files with 39 additions and 16 deletions
|
@ -86,8 +86,10 @@ class acp_groups
|
||||||
|
|
||||||
// Approve, demote or promote
|
// Approve, demote or promote
|
||||||
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
|
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
|
||||||
group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
|
$error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'demote':
|
case 'demote':
|
||||||
|
@ -104,6 +106,12 @@ class acp_groups
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
|
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'default':
|
case 'default':
|
||||||
|
|
|
@ -2838,7 +2838,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
|
|
||||||
if (!sizeof($user_id_ary) || $result !== false)
|
if (!sizeof($user_id_ary) || $result !== false)
|
||||||
{
|
{
|
||||||
return false;
|
return 'NO_USERS';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$group_name)
|
if (!$group_name)
|
||||||
|
@ -2850,9 +2850,23 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
{
|
{
|
||||||
case 'demote':
|
case 'demote':
|
||||||
case 'promote':
|
case 'promote':
|
||||||
|
|
||||||
|
$sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . "
|
||||||
|
WHERE group_id = $group_id
|
||||||
|
AND user_pending = 1
|
||||||
|
AND " . $db->sql_in_set('user_id', $user_id_ary);
|
||||||
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$not_empty = ($db->sql_fetchrow($result));
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
if ($not_empty)
|
||||||
|
{
|
||||||
|
return 'NO_VALID_USERS';
|
||||||
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USER_GROUP_TABLE . '
|
$sql = 'UPDATE ' . USER_GROUP_TABLE . '
|
||||||
SET group_leader = ' . (($action == 'promote') ? 1 : 0) . "
|
SET group_leader = ' . (($action == 'promote') ? 1 : 0) . "
|
||||||
WHERE group_id = $group_id
|
WHERE group_id = $group_id
|
||||||
|
AND user_pending = 0
|
||||||
AND " . $db->sql_in_set('user_id', $user_id_ary);
|
AND " . $db->sql_in_set('user_id', $user_id_ary);
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -2946,7 +2960,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
|
|
||||||
group_update_listings($group_id);
|
group_update_listings($group_id);
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -108,6 +108,7 @@ $lang = array_merge($lang, array(
|
||||||
'NO_PERMISSIONS' => 'Do not copy permissions',
|
'NO_PERMISSIONS' => 'Do not copy permissions',
|
||||||
'NO_USERS' => 'You haven’t entered any users.',
|
'NO_USERS' => 'You haven’t entered any users.',
|
||||||
'NO_USERS_ADDED' => 'No users were added to the group.',
|
'NO_USERS_ADDED' => 'No users were added to the group.',
|
||||||
|
'NO_VALID_USERS' => 'You haven’t entered any users eligible for that action.',
|
||||||
|
|
||||||
'SPECIAL_GROUPS' => 'Pre-defined groups',
|
'SPECIAL_GROUPS' => 'Pre-defined groups',
|
||||||
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',
|
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',
|
||||||
|
|
Loading…
Add table
Reference in a new issue