diff --git a/src/UnicaenAuthentification/View/Helper/UserConnection.php b/src/UnicaenAuthentification/View/Helper/UserConnection.php index f68abc14858d806687a668adc468f0bf818938b5..d2465f4e91f22f970909ca222ecbeacbdea11650 100644 --- a/src/UnicaenAuthentification/View/Helper/UserConnection.php +++ b/src/UnicaenAuthentification/View/Helper/UserConnection.php @@ -35,6 +35,13 @@ class UserConnection extends UserAbstract return $out; } + public function computeConnectionLink() + { + $urlHelper = $this->getView()->plugin('url'); + $href = $urlHelper('zfcuser/login'); + if ($this->onlyCas) $href = $urlHelper('zfcuser/authenticate',['type' => 'cas']); + return $href; + } /** * * @return string @@ -47,8 +54,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']); + $href = $this->computeConnectionLink(); $lib = "Connexion"; $title = "Affiche le formulaire d'authentification"; }