Skip to content
Snippets Groups Projects
Commit 3d299923 authored by Robin Appelman's avatar Robin Appelman
Browse files

user Group->users as assosiative array

parent b1263747
Branches
No related tags found
No related merge requests found
...@@ -90,14 +90,12 @@ class Group { ...@@ -90,14 +90,12 @@ class Group {
* @return bool * @return bool
*/ */
public function inGroup($user) { public function inGroup($user) {
foreach ($this->users as $cachedUser) { if (isset($this->users[$user->getUID()])) {
if ($user->getUID() === $cachedUser->getUID()) {
return true; return true;
} }
}
foreach ($this->backends as $backend) { foreach ($this->backends as $backend) {
if ($backend->inGroup($user->getUID(), $this->gid)) { if ($backend->inGroup($user->getUID(), $this->gid)) {
$this->users[] = $user; $this->users[$user->getUID()] = $user;
return true; return true;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment