Permalink
Browse files

Merge branch 'MDL-27040_20' of git://github.com/timhunt/moodle into M…

…OODLE_20_STABLE
  • Loading branch information...
stronk7 committed Jul 6, 2011
2 parents a35be2f + ae91207 commit 4bd293ee63f403f259b7b89a3176ee21ac98cc77
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/accesslib.php
View
@@ -5007,7 +5007,11 @@ function get_users_by_capability($context, $capability, $fields = '', $sort = ''
if ($useviewallgroups) {
$viewallgroupsusers = get_users_by_capability($context, 'moodle/site:accessallgroups', 'u.id, u.id', '', '', '', '', $exceptions);
- $wherecond[] = "($grouptest OR u.id IN (" . implode(',', array_keys($viewallgroupsusers)) . '))';
+ if (!empty($viewallgroupsusers)) {
+ $wherecond[] = "($grouptest OR u.id IN (" . implode(',', array_keys($viewallgroupsusers)) . '))';
+ } else {
+ $wherecond[] = "($grouptest)";
+ }
} else {
$wherecond[] = "($grouptest)";
}

0 comments on commit 4bd293e

Please sign in to comment.