public function SimpleLdapServer::exists in Simple LDAP 7
Same name and namespace in other branches
- 7.2 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;
}