Commit 232e7639 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fonction de calcul du lien pour pouvoir le rexploiter par ailleurs

parent 337919a0
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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";
        }