mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Avoiding some itarations. MDL-7902. Thanks Samuli!
Merged from MOODLE_17_STABLE
This commit is contained in:
parent
5c8b250f37
commit
a5855a89bf
@ -170,25 +170,10 @@
|
||||
return get_users_by_capability(get_context_instance(CONTEXT_COURSE, $courseid), 'moodle/course:view');
|
||||
}
|
||||
|
||||
//Returns all users (every record in users table)
|
||||
|
||||
//Returns all users ids (every record in users table)
|
||||
function backup_get_all_users() {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$result = false;
|
||||
|
||||
//Get users
|
||||
$users = get_records_sql("SELECT DISTINCT id,id
|
||||
FROM {$CFG->prefix}user");
|
||||
//Add users
|
||||
if ($users) {
|
||||
foreach ($users as $user) {
|
||||
$result[$user->id]->id = $user->id;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
return get_records('user', '', '', '', 'id, id');
|
||||
}
|
||||
|
||||
//Calculate the number of log entries to backup
|
||||
@ -2245,4 +2230,4 @@
|
||||
}
|
||||
fwrite ($bf, end_tag("ROLES_ASSIGNMENTS", $startlevel, true));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user