Permalink
Browse files

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

…ecord
  • Loading branch information...
1 parent db01754 commit 58c8b68c3c97ffe14eacf34b371ac13a023312bb @rajeshtaneja rajeshtaneja committed Mar 11, 2013
Showing with 11 additions and 2 deletions.
  1. +11 −2 admin/user.php
View
@@ -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;

0 comments on commit 58c8b68

Please sign in to comment.