Avoiding some itarations. MDL-7902. Thanks Samuli!

Merged from MOODLE_17_STABLE
This commit is contained in:
stronk7 2007-01-14 12:11:33 +00:00
parent 5c8b250f37
commit a5855a89bf

View File

@ -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));
}
?>
?>