]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: don't forget to unbind
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 16 Apr 2012 16:03:02 +0000 (18:03 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 16 Apr 2012 16:03:02 +0000 (18:03 +0200)
apps/user_ldap/lib_ldap.php

index ab815171b8da6e5774d9b8fb564b8728b9e23a1c..eea4a82011cd1a5067ee4b4381c45ea099bf69a1 100644 (file)
 
 define('LDAP_GROUP_MEMBER_ASSOC_ATTR','memberUid');
 
+//needed to unbind, because we use OC_LDAP only statically
+class OC_LDAP_DESTRUCTOR {
+       public function __destruct() {
+               OC_LDAP::destruct();
+       }
+}
+
 class OC_LDAP {
        static protected $ldapConnectionRes = false;
        static protected $configured = false;
@@ -43,6 +50,10 @@ class OC_LDAP {
                self::establishConnection();
        }
 
+       static public function destruct() {
+               @ldap_unbind(self::$ldapConnectionRes);
+       }
+
        static public function conf($key) {
                $availableProperties = array(
                        'ldapUserDisplayName',