Commit af3c6d6f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Le service UserContext est désormais construit par une factory

parent f292b106
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
use UnicaenAuth\Controller\AuthControllerFactory;
use UnicaenAuth\Service\ShibService;
use UnicaenAuth\Service\ShibServiceFactory;
use UnicaenAuth\Service\UserContextFactory;
use UnicaenAuth\View\Helper\ShibConnectViewHelperFactory;

$settings = [
@@ -373,7 +374,6 @@ return [
            'UnicaenAuth\Authentication\Storage\Ldap' => 'UnicaenAuth\Authentication\Storage\Ldap',
            'UnicaenAuth\Authentication\Storage\Shib' => 'UnicaenAuth\Authentication\Storage\Shib',
            'UnicaenAuth\View\RedirectionStrategy'    => 'UnicaenAuth\View\RedirectionStrategy',
            'UnicaenAuth\Service\UserContext'         => 'UnicaenAuth\Service\UserContext',
            'UnicaenAuth\Service\User'                => 'UnicaenAuth\Service\User',
            'UnicaenAuth\Service\CategoriePrivilege'  => 'UnicaenAuth\Service\CategoriePrivilegeService',
        ],
@@ -396,6 +396,7 @@ return [
            'BjyAuthorize\Service\Authorize'           => 'UnicaenAuth\Service\AuthorizeServiceFactory', // substituion
            'zfcuser_redirect_callback'                => 'UnicaenAuth\Authentication\RedirectCallbackFactory', // substituion
            ShibService::class                         => ShibServiceFactory::class,
            'UnicaenAuth\Service\UserContext'          => UserContextFactory::class,
            'MouchardCompleterAuth'        => 'UnicaenAuth\Mouchard\MouchardCompleterAuthFactory',
        ],
        'shared' => [
+19 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenAuth\Service;

use Zend\ServiceManager\ServiceLocatorInterface;

class UserContextFactory
{
    /**
     * @param ServiceLocatorInterface $sl
     * @return UserContext
     */
    public function __invoke(ServiceLocatorInterface $sl)
    {
        $service = new UserContextService();

        return $service;
    }
}
 No newline at end of file