diff --git a/core/src/plugins/auth.ldap/class.ldapAuthDriver.php b/core/src/plugins/auth.ldap/class.ldapAuthDriver.php index 66b04023f1..535b5b2909 100644 --- a/core/src/plugins/auth.ldap/class.ldapAuthDriver.php +++ b/core/src/plugins/auth.ldap/class.ldapAuthDriver.php @@ -918,8 +918,16 @@ public function saveCountToCache($fileContent) } } + public static $allowedGroupList; + + /*** + * @return array : list of groups according to ldap group filter string + */ public function getLdapGroupListFromDN() { + if (isset(self::$allowedGroupList) && !(empty(self::$allowedGroupList)) && count(self::$allowedGroupList) > 0) + return self::$allowedGroupList; + $origUsersDN = $this->ldapDN; $origUsersFilter = $this->ldapFilter; $origUsersAttr = $this->ldapUserAttr; @@ -946,6 +954,7 @@ public function getLdapGroupListFromDN() $this->ldapFilter = $origUsersFilter; $this->ldapUserAttr = $origUsersAttr; + self::$allowedGroupList = $returnArray; return $returnArray; } } \ No newline at end of file