public function SimpleLdap::ldapUnbind in Simple LDAP 8
Wrapper function for ldap_unbind().
Return value
boolean TRUE on success
Throws
1 call to SimpleLdap::ldapUnbind()
File
- src/
SimpleLdap.php, line 244
Class
- SimpleLdap
- A wrapper for PHP's LDAP functions, with associated helper methods.
Namespace
Drupal\simple_ldapCode
public function ldapUnbind() {
$return = FALSE;
// Check that the LDAP connection is currently bound.
if ($this->bound && $this->connection
->getResource()) {
// If unbinding is successful, $return should be TRUE.
$return = @ldap_unbind($this->connection
->getResource());
if (!$return) {
throw new SimpleLdapException('ldap_unbind wrapper: ', $this->connection
->getResource());
}
}
$this->bound = FALSE;
return $return;
}