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

Commit cf87f9d3 authored by Akhil's avatar Akhil 🙂
Browse files

Use connection attribute of ldap access object

parent 0135531e
Loading
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -83,16 +83,16 @@ 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);
				$requiredLDAPattributes = [
					'dn',
					strtolower($access->connection->ldapExpertUsernameAttr),
					strtolower($access->connection->ldapUserDisplayName)
				];
		
				$users = $access->fetchUsersByLoginName($uid, $requiredLDAPattributes);
				if (count($users) > 0) {
					$exists = true;