summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-18 16:46:16 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-18 16:46:16 -0500
commit6d69d89cfea15e2a626cdf9378b75a3dfae65d4a (patch)
tree339289b1b62391dd0760a461a2e7f2016017b50e
parent6a505da981c47057a2d8e65e1a208b9aad35dc73 (diff)
Reuse ldap connections for the default config
-rw-r--r--plugins/LdapAuthentication/LdapAuthenticationPlugin.php4
-rw-r--r--plugins/LdapAuthorization/LdapAuthorizationPlugin.php4
2 files changed, 8 insertions, 0 deletions
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index 25531a811..9e089485c 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -160,6 +160,10 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
function ldap_get_connection($config = null){
if($config == null){
+ static $ldap = null;
+ if($ldap != null){
+ return $ldap;
+ }
$config = $this->ldap_get_config();
}
diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
index 69357f8aa..91a343f40 100644
--- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
+++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
@@ -159,6 +159,10 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
//-----the below function were copied from LDAPAuthenticationPlugin. They will be moved to a utility class soon.----\\
function ldap_get_connection($config = null){
if($config == null){
+ static $ldap = null;
+ if($ldap != null){
+ return $ldap;
+ }
$config = $this->ldap_get_config();
}