]> source.dussan.org Git - nextcloud-server.git/commitdiff
user Group->users as assosiative array
authorRobin Appelman <icewind@owncloud.com>
Wed, 11 Dec 2013 15:25:41 +0000 (16:25 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 11 Dec 2013 15:25:41 +0000 (16:25 +0100)
lib/private/group/group.php

index 694827d100e2dd5c5713549f6f8fadb5ccf49629..97f1cb8d960b88dbe5fa6af9f071dca920b1c45d 100644 (file)
@@ -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;
                        }
                }