Commit 5b8fee0a authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fix route casssé

parent 34207bbd
Loading
Loading
Loading
Loading
+27 −2
Changes for config/autoload/unicaen-authentification.global.php: 27 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@
 * UnicaenAuthentification Global Configuration
 */

use Application\View\Helper\TestConnectViewHelper;
use Application\View\Helper\TestConnectViewHelperFactory;
use Laminas\Authentication\Adapter\Ldap;
use UnicaenAuthentification\Form\LoginForm;

return [
    'unicaen-auth' =>  [
        /**
@@ -14,12 +19,32 @@ return [
        'entity_manager_name' => 'doctrine.entitymanager.orm_default', // nom du gestionnaire d'entités à utiliser

        /**
         * Attribut LDAP utilisé pour le username des utilisateurs
         * A personnaliser au besoin
         * Attribut LDAP utilisé pour le "username" des utilisateurs
         * À personnaliser au besoin
         */
//        'ldap_username' => 'uid',
//        'ldap_username' => 'supannaliaslogin',

        'auth_types' => [
            'local', // càd 'ldap' et 'db'
            'cas',
            'shib',
            'test',
        ],

        'test' => [
            'enabled' => false,
            //'adapter' => Ldap::class,
            'form' => LoginForm::class,
        ],
    ],
    'view_helpers' => [
        'aliases' => [
            'testConnect' => TestConnectViewHelper::class,
        ],
        'factories' => [
            TestConnectViewHelper::class => TestConnectViewHelperFactory::class,
        ],
    ],
];

+32 −0
Changes for module/Application/src/Application/View/Helper/TestConnectViewHelper.php: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application\View\Helper;

use Laminas\View\Renderer\PhpRenderer;
use UnicaenAuthentification\View\Helper\AbstractConnectViewHelper;

/**
 * Aide de vue dessinant le bouton de connexion via Shibboleth,
 * si l'authentification Shibboleth est activée.
 *
 * @method PhpRenderer getView()
 * @author Unicaen
 */
class TestConnectViewHelper extends AbstractConnectViewHelper
{
    const TYPE = 'test';
    const TITLE = "Mon onglet de test";

    public function __construct()
    {
        $this->setType(self::TYPE);
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return "test";
    }
}
 No newline at end of file
+32 −0
Changes for module/Application/src/Application/View/Helper/TestConnectViewHelperFactory.php: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application\View\Helper;

use Interop\Container\ContainerInterface;
use UnicaenAuthentification\Options\ModuleOptions;
use UnicaenAuthentification\View\Helper\ShibConnectViewHelper;

class TestConnectViewHelperFactory
{
    /**
     * @param ContainerInterface $container
     * @return TestConnectViewHelper
     */
    public function __invoke(ContainerInterface $container)
    {
        /** @var ModuleOptions $moduleOptions */
        $moduleOptions = $container->get('unicaen-auth_module_options');
        $config = $moduleOptions->getShib();

        $enabled = isset($config['enabled']) && (bool) $config['enabled'];
        $title = $config['title'] ?? null;
        $description = $config['description'] ?? null;

        $helper = new TestConnectViewHelper();
        $helper->setEnabled($enabled);
        $helper->setTitle($title ?? TestConnectViewHelper::TITLE);
        $helper->setDescription($description);

        return $helper;
    }
}
 No newline at end of file
+1 −1
Changes for module/EntretienProfessionnel/view/entretien-professionnel/entretien-professionnel/partial/header.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ $canAfficherInformationMetier = (
                                    <?php if ($first) $first=false; else echo '<br/>'; ?>
                                    <a
                                        <?php /** @see \Application\Controller\FicheMetierController::afficherAction() */ ?>
                                        href="<?php echo $this->url('fiche-metier/afficher', ['id' => $fichemetier->getId()], [], true); ?>"
                                        href="<?php echo $this->url('fiche-metier/afficher', ['fiche-metier' => $fichemetier->getId()], [], true); ?>"
                                        target="_blank"
                                    >
                                        <?php