You are here

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

Same name and namespace in other branches
  1. 8.2 ldap_servers/LdapServer.class.php \LdapServer::disconnect()
  2. 7.2 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_servers/tests/LdapServerTest.class.php
Disconnect (unbind) from an active LDAP server.

File

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

Class

LdapServer
LDAP Server Class

Code

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

    // never bound or not currently bound, so no need to disconnect

    //watchdog('ldap', 'LDAP disconnect failure from '. $this->server_addr . ':' . $this->port);
  }
  else {
    ldap_unbind($this->connection);
    $this->connection = NULL;
  }
}