Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authoralexweirig <alex.weirig@technolink.lu>2016-03-21 10:06:38 +0300
committerVincent Petry <pvince81@owncloud.com>2016-06-01 17:27:52 +0300
commitc342dcbcee24e31544c2f2c91d5259d6dee56370 (patch)
tree9557fc6bacc502c89dace084b8a396f1b9cb76b0 /apps
parent6d74ef71b5b990c1685e95500d56c47645c379b8 (diff)
Fixing group handling
added back the cache processing and fixed
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/group_ldap.php21
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;
}