You are here

public static function SimpleLdap::ldap_unbind in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 SimpleLdap.class.php \SimpleLdap::ldap_unbind()

Wrapper function for ldap_unbind().

@throw SimpleLdapException

Parameters

resource $link_identifier: An LDAP link identifier.

Return value

boolean TRUE on success

1 call to SimpleLdap::ldap_unbind()
SimpleLdapServer::unbind in ./SimpleLdapServer.class.php
Unbind from the LDAP server.

File

./SimpleLdap.class.php, line 367
Class defining base Simple LDAP functionallity.

Class

SimpleLdap
Simple LDAP class.

Code

public static function ldap_unbind($link_identifier) {

  // Devel debugging.
  if (variable_get('simple_ldap_devel', FALSE)) {
    dpm(__FUNCTION__);
  }

  // Wrapped function call.
  $return = @ldap_unbind($link_identifier);

  // Debugging.
  if (variable_get('simple_ldap_debug', FALSE)) {
    $message = __FUNCTION__ . '($link_identifier = @link_identifier) returns @return';
    $variables = array(
      '@link_identifier' => print_r($link_identifier, TRUE),
      '@return' => print_r($return, TRUE),
    );
    watchdog('simple_ldap', $message, $variables, WATCHDOG_DEBUG);
  }

  // Error handling.
  if (!$return) {
    throw new SimpleLdapException($link_identifier);
  }
  return $return;
}