summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEric Helgeson <erichelgeson@gmail.com>2009-12-18 18:27:45 -0600
committerEric Helgeson <erichelgeson@gmail.com>2009-12-18 18:27:45 -0600
commit4002c18065eb324e983a1ecb997af9d2f9b18dde (patch)
treef7fd6ea015ac2f1df47a918c41b87c093d271342 /plugins
parent490238faf68b1bdfbb5441994a06ffb64cf574d2 (diff)
Allow caching of ldap schema, greatly improves performance.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/LdapAuthentication/LdapAuthenticationPlugin.php9
-rw-r--r--plugins/LdapAuthentication/README2
2 files changed, 11 insertions, 0 deletions
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index f688a3f7e..0ce08bd78 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -174,6 +174,15 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
return false;
}
if($config == null) $this->default_ldap=$ldap;
+
+ if (isset($this->schema_cachefile)) {
+ $cacheConfig = array(
+ 'path' => $this->schema_cachefile,
+ 'max_age' => (isset($this->schema_maxage) ? $this->schema_maxage : 1200 )
+ );
+ $cacheObj = new Net_LDAP2_SimpleFileSchemaCache($cacheConfig);
+ $ldap->registerSchemaCache($cacheObj);
+ }
return $ldap;
}
diff --git a/plugins/LdapAuthentication/README b/plugins/LdapAuthentication/README
index 2226159c2..0460fb639 100644
--- a/plugins/LdapAuthentication/README
+++ b/plugins/LdapAuthentication/README
@@ -42,6 +42,8 @@ filter: Default search filter.
See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
scope: Default search scope.
See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
+schema_cachefile: File location to store ldap schema.
+schema_maxage: TTL for cache file.
attributes: an array that relates StatusNet user attributes to LDAP ones
username*: LDAP attribute value entered when authenticating to StatusNet