You are here

public static function SimpleLdap::ldap_delete in Simple LDAP 7.2

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

Wrapper function for ldap_delete().

@throw SimpleLdapException

Parameters

resource $link_identifier: An LDAP link identifier.

string $dn: The distinguished name of an LDAP entity.

Return value

boolean TRUE on success.

1 call to SimpleLdap::ldap_delete()
SimpleLdapServer::delete in ./SimpleLdapServer.class.php
Delete an entry from the directory.

File

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

Class

SimpleLdap
Simple LDAP class.

Code

public static function ldap_delete($link_identifier, $dn) {

  // Devel debugging.
  if (variable_get('simple_ldap_devel', FALSE)) {
    dpm(__FUNCTION__);
    dpm(array(
      '$dn' => $dn,
    ));
  }

  // Wrapped function call.
  $return = @ldap_delete($link_identifier, $dn);

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

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