Skip to content

Commit

Permalink
MDL-13235 - bulk user action removing users etc was buggy,
Browse files Browse the repository at this point in the history
merged from MOODLE_19_STABLE
  • Loading branch information
poltawski committed Feb 5, 2008
1 parent cba498f commit a5137c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions admin/user/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function add_selection_all($ufiltering) {


if ($rs = get_recordset_select('user', $sqlwhere, 'fullname', 'id,'.sql_fullname().' AS fullname')) { if ($rs = get_recordset_select('user', $sqlwhere, 'fullname', 'id,'.sql_fullname().' AS fullname')) {
while ($user = rs_fetch_next_record($rs)) { while ($user = rs_fetch_next_record($rs)) {
if (!in_array($user->id, $SESSION->bulk_users)) { if (! isset($SESSION->bulk_users[$user->id])) {
$SESSION->bulk_users[] = $user->id; $SESSION->bulk_users[$user->id] = $user->id;
} }
} }
rs_close($rs); rs_close($rs);
Expand All @@ -40,7 +40,7 @@ function get_selection_data($ufiltering) {
if ($scount < MAX_BULK_USERS) { if ($scount < MAX_BULK_USERS) {
$in = implode(',', $SESSION->bulk_users); $in = implode(',', $SESSION->bulk_users);
} else { } else {
$bulkusers = array_slice($SESSION->bulk_users, 0, MAX_BULK_USERS); $bulkusers = array_slice($SESSION->bulk_users, 0, MAX_BULK_USERS, true);
$in = implode(',', $bulkusers); $in = implode(',', $bulkusers);
} }
$userlist['susers'] = get_records_select_menu('user', "id IN ($in)", 'fullname', 'id,'.sql_fullname().' AS fullname'); $userlist['susers'] = get_records_select_menu('user', "id IN ($in)", 'fullname', 'id,'.sql_fullname().' AS fullname');
Expand Down
4 changes: 2 additions & 2 deletions admin/user/user_bulk.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
if ($userid == -1) { if ($userid == -1) {
continue; continue;
} }
if (!in_array($userid, $SESSION->bulk_users)) { if (!isset($SESSION->bulk_users[$userid])) {
$SESSION->bulk_users[] = $userid; $SESSION->bulk_users[$userid] = $userid;
} }
} }
} }
Expand Down

0 comments on commit a5137c5

Please sign in to comment.