]> source.dussan.org Git - nextcloud-server.git/commitdiff
user_ldap: close ldap connection in dtor
authorDominik Schmidt <dev@dominik-schmidt.de>
Thu, 23 Jun 2011 21:54:39 +0000 (23:54 +0200)
committerDominik Schmidt <dev@dominik-schmidt.de>
Thu, 23 Jun 2011 21:57:18 +0000 (23:57 +0200)
apps/user_ldap/user_ldap.php

index 1718a307ccdfcd3bb7b74d790cfa59d07616f1db..1ee9809b3bb48cdc52794eed161edfeed14bcddd 100644 (file)
@@ -44,6 +44,12 @@ class OC_USER_LDAP extends OC_USER_BACKEND {
                $this->ldap_filter = OC_APPCONFIG::getValue('user_ldap', 'ldap_filter','');
        }
 
+       function __destruct() {
+               // close the connection
+               if( $this->ds )
+                       ldap_unbind($this->ds);
+       }
+
        private function getDs() {
                if(!$this->ds) {
                        $this->ds = ldap_connect( $this->ldap_host, $this->ldap_port );