mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-25708 recordsets - fix admin dir uses
This commit is contained in:
parent
8cdc85ac62
commit
755d2c74f6
6 changed files with 63 additions and 69 deletions
|
@ -25,16 +25,15 @@ echo $OUTPUT->header();
|
|||
if ($confirm and confirm_sesskey()) {
|
||||
|
||||
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
|
||||
if ($rs = $DB->get_recordset_select('user', "id $in", $params)) {
|
||||
foreach ($rs as $user) {
|
||||
if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
|
||||
unset($SESSION->bulk_users[$user->id]);
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
|
||||
}
|
||||
$rs = $DB->get_recordset_select('user', "id $in", $params);
|
||||
foreach ($rs as $user) {
|
||||
if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
|
||||
unset($SESSION->bulk_users[$user->id]);
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
|
||||
}
|
||||
$rs->close();
|
||||
}
|
||||
$rs->close();
|
||||
session_gc(); // remove stale sessions
|
||||
redirect($return, get_string('changessaved'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue