diff options
author | erangamapa <erangamapa@gmail.com> | 2013-02-21 22:25:12 +0530 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2013-02-24 18:12:35 +0100 |
commit | 880786d68610aff0c30573dc599af9e5b3ad56cf (patch) | |
tree | 9613fe3ac380e1e446128a05a3f5459ed865cbeb /phpBB | |
parent | 373c9a3f4ea92f1bcbe63404a2b3bf356fe5abcb (diff) | |
download | forums-880786d68610aff0c30573dc599af9e5b3ad56cf.tar forums-880786d68610aff0c30573dc599af9e5b3ad56cf.tar.gz forums-880786d68610aff0c30573dc599af9e5b3ad56cf.tar.bz2 forums-880786d68610aff0c30573dc599af9e5b3ad56cf.tar.xz forums-880786d68610aff0c30573dc599af9e5b3ad56cf.zip |
[ticket/11358] Removed redundant code and referred proper variable.
Error was thrown when no users are selected before executing the code
chunk which manually adds all the user to make the group default.
Removed this code and referred $mark_ary instead of $name_ary which
will not have selected user ids.
PHPBB3-11358
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/acp/acp_groups.php | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index dbe692aee0..af25d9d014 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -120,7 +120,7 @@ class acp_groups { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } - else if (!$name_ary) + else if (empty($mark_ary)) { trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } @@ -128,45 +128,7 @@ class acp_groups if (confirm_box(true)) { $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; - - if (!sizeof($mark_ary)) - { - $start = 0; - - do - { - $sql = 'SELECT user_id - FROM ' . USER_GROUP_TABLE . " - WHERE group_id = $group_id - ORDER BY user_id"; - $result = $db->sql_query_limit($sql, 200, $start); - - $mark_ary = array(); - if ($row = $db->sql_fetchrow($result)) - { - do - { - $mark_ary[] = $row['user_id']; - } - while ($row = $db->sql_fetchrow($result)); - - group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row); - - $start = (sizeof($mark_ary) < 200) ? 0 : $start + 200; - } - else - { - $start = 0; - } - $db->sql_freeresult($result); - } - while ($start); - } - else - { - 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); trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } else |