From: Neraste Date: Sun, 26 Nov 2017 23:16:54 +0000 (+0100) Subject: Fix #4789: Group admins cannot see disabled users X-Git-Tag: v12.0.6RC1~80^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F8006%2Fhead;p=nextcloud-server.git Fix #4789: Group admins cannot see disabled users Signed-off-by: Arthur Schiwon --- diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 36ac263b8cd..fc0aa4118aa 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -302,7 +302,9 @@ class UsersController extends Controller { // Batch all groups the user is subadmin of when a group is specified $batch = []; - if($gid === '') { + if ($gid !== '' && $gid !== '_disabledUsers' && $gid !== '_everyone') { + $batch = $this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset); + } else { foreach($subAdminOfGroups as $group) { $groupUsers = $this->groupManager->displayNamesInGroup($group, $pattern, $limit, $offset); @@ -310,8 +312,6 @@ class UsersController extends Controller { $batch[$uid] = $displayName; } } - } else { - $batch = $this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset); } $batch = $this->getUsersForUID($batch);