You are here

public function LdapServer::userUsernameFromDn in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_servers/LdapServer.class.php \LdapServer::userUsernameFromDn()

UserUsernameFromDn.

Parameters

string $dn:

Return value

mixed string user's username value of FALSE

File

ldap_servers/LdapServer.class.php, line 1161
Defines server classes and related functions.

Class

LdapServer
LDAP Server Class.

Code

public function userUsernameFromDn($dn) {
  $ldap_entry = @$this
    ->dnExists($dn, 'ldap_entry', []);
  if (!$ldap_entry || !is_array($ldap_entry)) {
    return FALSE;
  }
  else {
    return $this
      ->userUsernameFromLdapEntry($ldap_entry);
  }
}