mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-14978 removed obsoleted get_group_users()
This commit is contained in:
parent
c5eb1adbf9
commit
c4d61f7af0
@ -628,39 +628,6 @@ function mygroupid($courseid) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of user objects
|
||||
*
|
||||
* @uses $CFG
|
||||
* @param int $groupid The group in question.
|
||||
* @param string $sort ?
|
||||
* @param string $exceptions ?
|
||||
* @return object
|
||||
* @todo Finish documenting this function
|
||||
*/
|
||||
function get_group_users($groupid, $sort='u.lastaccess DESC', $exceptions='',
|
||||
$fields='u.*') {
|
||||
global $CFG;
|
||||
if (!empty($exceptions)) {
|
||||
$except = ' AND u.id NOT IN ('. $exceptions .') ';
|
||||
} else {
|
||||
$except = '';
|
||||
}
|
||||
// in postgres, you can't have things in sort that aren't in the select, so...
|
||||
$extrafield = str_replace('ASC','',$sort);
|
||||
$extrafield = str_replace('DESC','',$extrafield);
|
||||
$extrafield = trim($extrafield);
|
||||
if (!empty($extrafield)) {
|
||||
$extrafield = ','.$extrafield;
|
||||
}
|
||||
return get_records_sql("SELECT DISTINCT $fields $extrafield
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}groups_members m
|
||||
WHERE m.groupid = '$groupid'
|
||||
AND m.userid = u.id $except
|
||||
ORDER BY $sort");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current group mode for a given course or activity module
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user