Skip to content

Commit

Permalink
MDL-43215 core_webservice: retrieve all user name fields when adding …
Browse files Browse the repository at this point in the history
…a token
  • Loading branch information
mdjnelson committed Dec 5, 2013
1 parent 9b37cd7 commit 626aec1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions admin/webservice/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ function definition() {

if ($usertotal < 500) {
list($sort, $params) = users_order_by_sql('u');
//user searchable selector - get all users (admin and guest included)
//user must be confirmed, not deleted, not suspended, not guest
$sql = "SELECT u.id, u.firstname, u.lastname
FROM {user} u
WHERE u.deleted = 0 AND u.confirmed = 1 AND u.suspended = 0 AND u.id != :siteguestid
ORDER BY $sort";
// User searchable selector - return users who are confirmed, not deleted, not suspended and not a guest.
$sql = 'SELECT u.id, ' . get_all_user_name_fields(true, 'u') . '
FROM {user} u
WHERE u.deleted = 0
AND u.confirmed = 1
AND u.suspended = 0
AND u.id != :siteguestid
ORDER BY ' . $sort;
$params['siteguestid'] = $CFG->siteguest;
$users = $DB->get_records_sql($sql, $params);
$options = array();
Expand Down

0 comments on commit 626aec1

Please sign in to comment.