Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0135531e authored by Akhil's avatar Akhil 🙂
Browse files

Fetch username and displayname attributes at creation from LDAP

parent a33e49aa
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -83,11 +83,17 @@ class UserService {
			return $exists;
		}

		$requiredLDAPattributes = [
			'dn',
			strtolower($this->connection->ldapExpertUsernameAttr),
			strtolower($this->connection->ldapUserDisplayName)
		];

		$backends = $this->userManager->getBackends();
		foreach ($backends as $backend) {
			if ($backend->getBackendName() === 'LDAP') {
				$access = $backend->getLDAPAccess($uid);
				$users = $access->fetchUsersByLoginName($uid) ;
				$users = $access->fetchUsersByLoginName($uid, $requiredLDAPattributes);
				if (count($users) > 0) {
					$exists = true;
				}