chore: cleaning

This commit is contained in:
2025-05-10 20:05:57 -05:00
parent 35a3e48ac9
commit ddb71b3bb0

View File

@@ -43,7 +43,6 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
private string $usernameAttribute;
private string $emailAttribute;
private string $displayNameAttribute;
private RoleFetcherInterface $roleFetcher;
public function __construct(
private UserRepository $userRepository,
@@ -65,7 +64,6 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
$this->uidKey = $uidKey;
$this->defaultSearch = str_replace('{uid_key}', $uidKey, $filter);
// $this->roleFetcher = $defaultRoles;
$this->usernameAttribute = $usernameAttribute;
$this->emailAttribute = $emailAttribute;
$this->displayNameAttribute = $displayNameAttribute;
@@ -158,12 +156,6 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
$extraFields[$field] = $this->getAttributeValue($entry, $field);
}
if (null !== $this->passwordAttribute) {
$password = $this->getAttributeValue($entry, $this->passwordAttribute);
}
// $roles = $this->roleFetcher->fetchRoles($entry);
$dbUser = $this->getDbUser($identifier);
if (null === $dbUser) {
@@ -182,22 +174,6 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
return $dbUser;
}
// protected function loadUser(string $identifier, Entry $entry): UserInterface
// {
// $password = null;
// $extraFields = [];
//
// if (null !== $this->passwordAttribute) {
// $password = $this->getAttributeValue($entry, $this->passwordAttribute);
// }
//
// foreach ($this->extraFields as $field) {
// $extraFields[$field] = $this->getAttributeValue($entry, $field);
// }
//
// return new LdapUser($entry, $identifier, $password, $this->defaultRoles, $extraFields);
// }
private function getDbUser(string $identifier): ?UserInterface
{
if (in_array($this->uidKey, ['mail', 'email'])) {