You are here

public function SimpleLdapServer::exists in Simple LDAP 7.2

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

Check whether the provided DN exists.

@throw SimpleLdapException

Parameters

string $dn: LDAP DN to verify.

Return value

boolean TRUE if the entry exists, FALSE otherwise.

File

./SimpleLdapServer.class.php, line 429
Class to handle LDAP server connections and related operations.

Class

SimpleLdapServer
Simple LDAP server class.

Code

public function exists($dn) {
  $entry = $this
    ->search($dn, '(objectclass=*)', 'base', array(
    'dn',
  ));
  return $entry['count'] > 0;
}