diff options
Diffstat (limited to 'lib/private/group/group.php')
-rw-r--r-- | lib/private/group/group.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/group/group.php b/lib/private/group/group.php index 694827d100e..97f1cb8d960 100644 --- a/lib/private/group/group.php +++ b/lib/private/group/group.php @@ -90,14 +90,12 @@ class Group { * @return bool */ public function inGroup($user) { - foreach ($this->users as $cachedUser) { - if ($user->getUID() === $cachedUser->getUID()) { - return true; - } + if (isset($this->users[$user->getUID()])) { + return true; } foreach ($this->backends as $backend) { if ($backend->inGroup($user->getUID(), $this->gid)) { - $this->users[] = $user; + $this->users[$user->getUID()] = $user; return true; } } |