Commit ccb95308 authored by David Surville's avatar David Surville
Browse files

Quelques corrections nécessaires après l'intégration de la branche...

Quelques corrections nécessaires après l'intégration de la branche release/1.3.0 dans la branche 5.x
parent f62c8de3
Loading
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -18,12 +18,6 @@ use ZfcUser\Entity\UserInterface;
 */
class Ldap extends AuthenticationIdentityProvider implements ChainableProvider
{
    protected $usernamefield;

    public function setUsernamefield(?string $value = null)
    {
        $this->usernamefield=$value;
    }
    /**
     * {@inheritDoc}
     */
@@ -56,7 +50,7 @@ class Ldap extends AuthenticationIdentityProvider implements ChainableProvider
        }

        if ($identity instanceof UserInterface) {
            $roles[] = $identity->getUsername($this->usernamefield);
            $roles[] = $identity->getUsername();
        }

        return $roles;
+0 −3
Original line number Diff line number Diff line
@@ -31,9 +31,6 @@ class LdapServiceFactory implements FactoryInterface
        $simpleIdentityProvider->setDefaultRole($config['default_role']);
        $simpleIdentityProvider->setAuthenticatedRole($config['authenticated_role']);
        
        $usernamefield = $container->get('Config')['unicaen-auth']['local']['ldap']['username'];
        $simpleIdentityProvider->setUsernamefield($usernamefield);

        return $simpleIdentityProvider;
    }
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ class UserContext extends AbstractService implements EventManagerAwareInterface
            return $user->getUsername();
        }
        if ($user = $this->getLdapUser()) {
            return $user->getUsername($this->usernamefield);
            return $user->getUsername();
        }
        if ($user = $this->getDbUser()) {
            return $user->getUsername();
+1 −2
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ class UserContextFactory
        // mais c'est impossible pour l'instant car il y a un cycle dans les dépendances entre services qui
        // provoque une boucle infinie.
        //
        $usernamefield = $container->get('Config')['unicaen-auth']['local']['ldap']['username'];
        $service->setUsernamefield($usernamefield);

        return $service;
    }
}
 No newline at end of file
+0 −17
Original line number Diff line number Diff line
@@ -90,21 +90,4 @@ class UserMapper implements UserInterface

        return $entity;
    }
    //===================



    /**
     * Recherche un utilisateur par son username (identifiant de connexion).
     *
     * @param string $username
     * @return AbstractUser|null
     */
    public function findOneByUsername($username)
    {
        /** @var AbstractUser $user */
        $user = $this->em->getRepository($this->options->getUserEntityClass())->findOneBy(['username' => $username]);

        return $user;
    }
}
 No newline at end of file
Loading