Skip to content

Commit

Permalink
Improved get_site_users a bit for efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed May 17, 2003
1 parent 2563c5e commit bbf9b16
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,14 @@ function get_site_users($sort="u.lastaccess DESC") {

global $CFG;

return get_records_sql("SELECT u.* FROM {$CFG->prefix}user u,
{$CFG->prefix}user_students s,
{$CFG->prefix}user_teachers t
WHERE s.userid = u.id
OR t.userid = u.id
GROUP BY u.id ORDER BY $sort");
return get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.maildisplay,
u.email, u.city, u.country, u.lastaccess, u.lastlogin, u.picture
FROM {$CFG->prefix}user u,
{$CFG->prefix}user_students s,
{$CFG->prefix}user_teachers t
WHERE s.userid = u.id
OR t.userid = u.id
GROUP BY u.id ORDER BY $sort");
}


Expand Down

0 comments on commit bbf9b16

Please sign in to comment.