Loading README.md +9 −1 Original line number Diff line number Diff line # UnicaenAuth ***UnicaenAuth*** --- **CHANGES** --- **5.0.2** * Si CAS est le seul type d'authentification alors le lien de connexion envoie directement vers le CAS sans passer par la sélection du type --- Ce module : - ajoute à une application la possibilité d'identifier/authentifier l'utilisateur (LDAP, base de données ou CAS). Loading src/UnicaenAuthentification/View/Helper/UserConnection.php +3 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ use UnicaenUtilisateur\View\Helper\UserAbstract; */ class UserConnection extends UserAbstract { public bool $onlyCas = false; /** * Point d'entrée. * Loading @@ -18,7 +20,6 @@ class UserConnection extends UserAbstract */ public function __invoke() { return $this; } /** Loading Loading @@ -47,6 +48,7 @@ class UserConnection extends UserAbstract $template = '<a class="navbar-link user-connection" href="%s" title="%s">%s</a>'; if (!$identity) { $href = $urlHelper('zfcuser/login'); if ($this->onlyCas) $href = $urlHelper('zfcuser/authenticate',['type' => 'cas']); $lib = "Connexion"; $title = "Affiche le formulaire d'authentification"; } Loading src/UnicaenAuthentification/View/Helper/UserConnectionFactory.php +10 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,17 @@ class UserConnectionFactory implements FactoryInterface public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $config = $container->get('Config')['unicaen-auth']; $activeModes = []; foreach ($config['auth_types'] as $type) { if ($config[$type]['enabled']) $activeModes[] = $type; } $onlyCas = (count($activeModes) === 1 AND $activeModes[0] === 'cas'); $authUserContext = $container->get('authUserContext'); return new UserConnection($authUserContext); $uc = new UserConnection($authUserContext); $uc->onlyCas = $onlyCas; return $uc; } } No newline at end of file Loading
README.md +9 −1 Original line number Diff line number Diff line # UnicaenAuth ***UnicaenAuth*** --- **CHANGES** --- **5.0.2** * Si CAS est le seul type d'authentification alors le lien de connexion envoie directement vers le CAS sans passer par la sélection du type --- Ce module : - ajoute à une application la possibilité d'identifier/authentifier l'utilisateur (LDAP, base de données ou CAS). Loading
src/UnicaenAuthentification/View/Helper/UserConnection.php +3 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ use UnicaenUtilisateur\View\Helper\UserAbstract; */ class UserConnection extends UserAbstract { public bool $onlyCas = false; /** * Point d'entrée. * Loading @@ -18,7 +20,6 @@ class UserConnection extends UserAbstract */ public function __invoke() { return $this; } /** Loading Loading @@ -47,6 +48,7 @@ class UserConnection extends UserAbstract $template = '<a class="navbar-link user-connection" href="%s" title="%s">%s</a>'; if (!$identity) { $href = $urlHelper('zfcuser/login'); if ($this->onlyCas) $href = $urlHelper('zfcuser/authenticate',['type' => 'cas']); $lib = "Connexion"; $title = "Affiche le formulaire d'authentification"; } Loading
src/UnicaenAuthentification/View/Helper/UserConnectionFactory.php +10 −1 Original line number Diff line number Diff line Loading @@ -20,8 +20,17 @@ class UserConnectionFactory implements FactoryInterface public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $config = $container->get('Config')['unicaen-auth']; $activeModes = []; foreach ($config['auth_types'] as $type) { if ($config[$type]['enabled']) $activeModes[] = $type; } $onlyCas = (count($activeModes) === 1 AND $activeModes[0] === 'cas'); $authUserContext = $container->get('authUserContext'); return new UserConnection($authUserContext); $uc = new UserConnection($authUserContext); $uc->onlyCas = $onlyCas; return $uc; } } No newline at end of file