Permalink
Browse files

MDL-13235 - bulk user action removing users etc was buggy,

merged from MOODLE_19_STABLE
  • Loading branch information...
1 parent cba498f commit a5137c503aed395d54e2dcf87079439a862ad3e0 poltawski committed Feb 5, 2008
Showing with 5 additions and 5 deletions.
  1. +3 −3 admin/user/lib.php
  2. +2 −2 admin/user/user_bulk.php
View
@@ -14,8 +14,8 @@ function add_selection_all($ufiltering) {
if ($rs = get_recordset_select('user', $sqlwhere, 'fullname', 'id,'.sql_fullname().' AS fullname')) {
while ($user = rs_fetch_next_record($rs)) {
- if (!in_array($user->id, $SESSION->bulk_users)) {
- $SESSION->bulk_users[] = $user->id;
+ if (! isset($SESSION->bulk_users[$user->id])) {
+ $SESSION->bulk_users[$user->id] = $user->id;
}
}
rs_close($rs);
@@ -40,7 +40,7 @@ function get_selection_data($ufiltering) {
if ($scount < MAX_BULK_USERS) {
$in = implode(',', $SESSION->bulk_users);
} 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);
}
$userlist['susers'] = get_records_select_menu('user', "id IN ($in)", 'fullname', 'id,'.sql_fullname().' AS fullname');
View
@@ -42,8 +42,8 @@
if ($userid == -1) {
continue;
}
- if (!in_array($userid, $SESSION->bulk_users)) {
- $SESSION->bulk_users[] = $userid;
+ if (!isset($SESSION->bulk_users[$userid])) {
+ $SESSION->bulk_users[$userid] = $userid;
}
}
}

0 comments on commit a5137c5

Please sign in to comment.