user_ldap: close ldap connection in dtor

This commit is contained in:
Dominik Schmidt 2011-06-23 23:54:39 +02:00
parent 5f29f8a831
commit 735738fe6f
1 changed files with 6 additions and 0 deletions

View 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 );