Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-38332 Users: Browse list of users should not contain guest user r…

…ecord
  • Loading branch information...
commit 58c8b68c3c97ffe14eacf34b371ac13a023312bb 1 parent db01754
Rajesh Taneja rajeshtaneja authored

Showing 1 changed file with 11 additions and 2 deletions. Show diff stats Hide diff stats

  1. +11 2 admin/user.php
13 admin/user.php
@@ -196,11 +196,20 @@
196 196 }
197 197
198 198 list($extrasql, $params) = $ufiltering->get_sql_filter();
199   - $users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
200   - $extrasql, $params, $context);
  199 +
201 200 $usercount = get_users(false);
202 201 $usersearchcount = get_users(false, '', false, null, "", '', '', '', '', '*', $extrasql, $params);
203 202
  203 + // Exclude guest user from list.
  204 + $noguestsql = '';
  205 + if (!empty($extrasql)) {
  206 + $noguestsql .= ' AND';
  207 + }
  208 + $noguestsql .= " id <> :guestid";
  209 + $params['guestid'] = $CFG->siteguest;
  210 + $users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
  211 + $extrasql.$noguestsql, $params, $context);
  212 +
204 213 if ($extrasql !== '') {
205 214 echo $OUTPUT->heading("$usersearchcount / $usercount ".get_string('users'));
206 215 $usercount = $usersearchcount;

0 comments on commit 58c8b68

Please sign in to comment.
Something went wrong with that request. Please try again.