]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Reuse ldap connections for the default config
authorCraig Andrews <candrews@integralblue.com>
Wed, 18 Nov 2009 21:46:16 +0000 (16:46 -0500)
committerCraig Andrews <candrews@integralblue.com>
Wed, 18 Nov 2009 21:46:16 +0000 (16:46 -0500)
plugins/LdapAuthentication/LdapAuthenticationPlugin.php
plugins/LdapAuthorization/LdapAuthorizationPlugin.php

index 25531a8116e6669ae5f8664ee190683418aa331c..9e089485c6e55da3552edb3108ee5e6959fcf5fd 100644 (file)
@@ -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();
         }
         
index 69357f8aad05b54ffff6eb4d9eadc64e6d2a3a17..91a343f4087ae0dfd5c8f953c70042a6428e4be2 100644 (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.----\\
     function ldap_get_connection($config = null){
         if($config == null){
+            static $ldap = null;
+            if($ldap != null){
+                return $ldap;
+            }
             $config = $this->ldap_get_config();
         }