Loading src/UnicaenUtilisateur/Entity/Db/HistoriqueAwareTrait.php +4 −4 Original line number Diff line number Diff line Loading @@ -250,11 +250,11 @@ trait HistoriqueAwareTrait public function estNonHistorise(DateTime $dateObs = null) { if (empty($dateObs)) { try { // try { $dateObs = new DateTime(); } catch (\Exception $e) { throw new RuntimeException("Impossible d'instancier un DateTime!", null, $e); } // } catch (\Exception $e) { // throw new RuntimeException("Impossible d'instancier un DateTime!", null, $e); // } } $dObs = $dateObs->format('Y-m-d'); Loading src/UnicaenUtilisateur/Provider/Role/Username.php +6 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ class Username implements ProviderInterface */ protected $roles; protected $usernamefield; /** * * @param AuthenticationService $authService Loading @@ -44,6 +45,10 @@ class Username implements ProviderInterface $this->config = $config; } public function setUsernamefield($usernamefield) { $this->usernamefield = $usernamefield; } /** * @return \Laminas\Permissions\Acl\Role\RoleInterface[] */ Loading @@ -65,7 +70,7 @@ class Username implements ProviderInterface $identity = $identity['db']; } if ($identity instanceof UserInterface) { $role = new NamedRole($identity->getUsername(), 'user', "Authentifié(e)", null, false); $role = new NamedRole($identity->getUsername($this->usernamefield), 'user', "Authentifié(e)", null, false); $this->roles[] = $role; } } Loading src/UnicaenUtilisateur/Provider/Role/UsernameServiceFactory.php +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ class UsernameServiceFactory implements FactoryInterface $authService = $container->get('zfcuser_auth_service'); /* @var $authService \Laminas\Authentication\AuthenticationService */ // $authService = $container->get('Laminas\Authentication\AuthenticationService'); /* @var $authService \Laminas\Authentication\AuthenticationService */ $usernamefield = $config['unicaen-auth']['local']['ldap']['username']; return new Username($authService, $providerConfig); } } No newline at end of file Loading
src/UnicaenUtilisateur/Entity/Db/HistoriqueAwareTrait.php +4 −4 Original line number Diff line number Diff line Loading @@ -250,11 +250,11 @@ trait HistoriqueAwareTrait public function estNonHistorise(DateTime $dateObs = null) { if (empty($dateObs)) { try { // try { $dateObs = new DateTime(); } catch (\Exception $e) { throw new RuntimeException("Impossible d'instancier un DateTime!", null, $e); } // } catch (\Exception $e) { // throw new RuntimeException("Impossible d'instancier un DateTime!", null, $e); // } } $dObs = $dateObs->format('Y-m-d'); Loading
src/UnicaenUtilisateur/Provider/Role/Username.php +6 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ class Username implements ProviderInterface */ protected $roles; protected $usernamefield; /** * * @param AuthenticationService $authService Loading @@ -44,6 +45,10 @@ class Username implements ProviderInterface $this->config = $config; } public function setUsernamefield($usernamefield) { $this->usernamefield = $usernamefield; } /** * @return \Laminas\Permissions\Acl\Role\RoleInterface[] */ Loading @@ -65,7 +70,7 @@ class Username implements ProviderInterface $identity = $identity['db']; } if ($identity instanceof UserInterface) { $role = new NamedRole($identity->getUsername(), 'user', "Authentifié(e)", null, false); $role = new NamedRole($identity->getUsername($this->usernamefield), 'user', "Authentifié(e)", null, false); $this->roles[] = $role; } } Loading
src/UnicaenUtilisateur/Provider/Role/UsernameServiceFactory.php +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ class UsernameServiceFactory implements FactoryInterface $authService = $container->get('zfcuser_auth_service'); /* @var $authService \Laminas\Authentication\AuthenticationService */ // $authService = $container->get('Laminas\Authentication\AuthenticationService'); /* @var $authService \Laminas\Authentication\AuthenticationService */ $usernamefield = $config['unicaen-auth']['local']['ldap']['username']; return new Username($authService, $providerConfig); } } No newline at end of file