You are here

public function LdapBaseManager::matchUsernameToExistingLdapEntry in Lightweight Directory Access Protocol (LDAP) 8.4

Match username to existing LDAP entry.

Parameters

string $drupal_username: Drupal username.

Return value

false|null|\Symfony\Component\Ldap\Entry LDAP Entry.

See also

\Drupal\ldap_servers\LdapUserManager::getUserDataByIdentifier

2 calls to LdapBaseManager::matchUsernameToExistingLdapEntry()
LdapGroupManager::groupMembershipsFromUser in ldap_servers/src/LdapGroupManager.php
Get list of all groups that a user is a member of.
LdapGroupManager::groupUserMembershipsFromDn in ldap_servers/src/LdapGroupManager.php
Get "groups" from derived from DN.

File

ldap_servers/src/LdapBaseManager.php, line 366

Class

LdapBaseManager
LDAP Base Manager.

Namespace

Drupal\ldap_servers

Code

public function matchUsernameToExistingLdapEntry(string $drupal_username) {
  $result = $this
    ->queryAllBaseDnLdapForUsername($drupal_username);
  if ($result !== FALSE) {
    $result = $this
      ->sanitizeUserDataResponse($result, $drupal_username);
  }
  return $result;
}