diff options
author | alexweirig <alex.weirig@technolink.lu> | 2016-03-21 10:06:38 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-01 17:27:52 +0300 |
commit | c342dcbcee24e31544c2f2c91d5259d6dee56370 (patch) | |
tree | 9557fc6bacc502c89dace084b8a396f1b9cb76b0 /apps | |
parent | 6d74ef71b5b990c1685e95500d56c47645c379b8 (diff) |
Fixing group handling
added back the cache processing and fixed
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index c698723bebc..069a7c161bc 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -530,12 +530,21 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { $uid = $userDN; } - if($primaryGroup !== false) { - $groups[] = $primaryGroup; - } - - $groups = array_unique($groups, SORT_LOCALE_STRING); - $this->access->connection->writeToCache($cacheKey, $groups); + if(isset($this->cachedGroupsByMember[$uid])) { + $groups[] = $this->cachedGroupsByMember[$uid]; + } else { + $groupsByMember = array_values($this->getGroupsByMember($uid)); + $groupsByMember = $this->access->ownCloudGroupNames($groupsByMember); + $this->cachedGroupsByMember[$uid] = $groupsByMember; + $groups = array_merge($groups, $groupsByMember); + } + + if($primaryGroup !== false) { + $groups[] = $primaryGroup; + } + + $groups = array_unique($groups, SORT_LOCALE_STRING); + $this->access->connection->writeToCache($cacheKey, $groups); return $groups; } |