Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Improve performance: caching ldap search result in class static variable
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Dec 31, 2015
1 parent 67dc95d commit 2327953
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/plugins/auth.ldap/class.ldapAuthDriver.php
Expand Up @@ -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;
Expand All @@ -946,6 +954,7 @@ public function getLdapGroupListFromDN()
$this->ldapFilter = $origUsersFilter;
$this->ldapUserAttr = $origUsersAttr;

self::$allowedGroupList = $returnArray;
return $returnArray;
}
}

0 comments on commit 2327953

Please sign in to comment.