Reuse ldap connections for the default config

This commit is contained in:
Craig Andrews 2009-11-18 16:46:16 -05:00
parent 6a505da981
commit 6d69d89cfe
2 changed files with 8 additions and 0 deletions

View File

@ -160,6 +160,10 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
function ldap_get_connection($config = null){ function ldap_get_connection($config = null){
if($config == null){ if($config == null){
static $ldap = null;
if($ldap != null){
return $ldap;
}
$config = $this->ldap_get_config(); $config = $this->ldap_get_config();
} }

View File

@ -159,6 +159,10 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
//-----the below function were copied from LDAPAuthenticationPlugin. They will be moved to a utility class soon.----\\ //-----the below function were copied from LDAPAuthenticationPlugin. They will be moved to a utility class soon.----\\
function ldap_get_connection($config = null){ function ldap_get_connection($config = null){
if($config == null){ if($config == null){
static $ldap = null;
if($ldap != null){
return $ldap;
}
$config = $this->ldap_get_config(); $config = $this->ldap_get_config();
} }