You are here

public function LdapServer::disconnect in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_servers/LdapServer.class.php \LdapServer::disconnect()
  2. 7 ldap_servers/LdapServer.class.php \LdapServer::disconnect()

Disconnect (unbind) from an active LDAP server.

1 call to LdapServer::disconnect()
LdapServer::__destruct in ldap_servers/LdapServer.class.php
Destructor Method.
1 method overrides LdapServer::disconnect()
LdapServerTest::disconnect in ldap_test/LdapServerTest.class.php
Disconnect (unbind) from an active LDAP server.

File

ldap_servers/LdapServer.class.php, line 452
Defines server classes and related functions.

Class

LdapServer
LDAP Server Class.

Code

public function disconnect() {
  if (!$this->connection) {

    // Never bound or not currently bound, so no need to disconnect
    // watchdog('ldap_servers', 'LDAP disconnect failure from '. $this->server_addr . ':' . $this->port);.
  }
  else {
    ldap_unbind($this->connection);
    $this->connection = NULL;
  }
}