Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ecord
  • Loading branch information...
commit 8256fae97ce22ac3b86c1a48fc673c41b5927e35 1 parent 1bfc006
@rajeshtaneja rajeshtaneja authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 admin/user.php
View
13 admin/user.php
@@ -196,11 +196,20 @@
}
list($extrasql, $params) = $ufiltering->get_sql_filter();
- $users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
- $extrasql, $params, $context);
+
$usercount = get_users(false);
$usersearchcount = get_users(false, '', false, null, "", '', '', '', '', '*', $extrasql, $params);
+ // Exclude guest user from list.
+ $noguestsql = '';
+ if (!empty($extrasql)) {
+ $noguestsql .= ' AND';
+ }
+ $noguestsql .= " id <> :guestid";
+ $params['guestid'] = $CFG->siteguest;
+ $users = get_users_listing($sort, $dir, $page*$perpage, $perpage, '', '', '',
+ $extrasql.$noguestsql, $params, $context);
+
if ($extrasql !== '') {
echo $OUTPUT->heading("$usersearchcount / $usercount ".get_string('users'));
$usercount = $usersearchcount;
Please sign in to comment.
Something went wrong with that request. Please try again.