Commit d31ff725 authored by David Surville's avatar David Surville
Browse files

[Evo] Passage de UnicaenAuth aux trois bibliothèques UnicaenAuthentificatuion...

[Evo] Passage de UnicaenAuth aux trois bibliothèques UnicaenAuthentificatuion / UnicaenPrivilege / UnicaenUtilisateur
parent b1710a97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ return [
                        'changer-statut',
                    ],
                    'privileges' => [
                        UtilisateurPrivileges::UTILISATEUR_CHANGER_STATUT,
                        UtilisateurPrivileges::UTILISATEUR_CHANGERSTATUS,
                    ],
                ],
                [
@@ -69,7 +69,7 @@ return [
                        'remove-role',
                    ],
                    'privileges' => [
                        UtilisateurPrivileges::UTILISATEUR_MODIFIER_ROLE,
                        UtilisateurPrivileges::UTILISATEUR_MODIFIERROLE,
                    ],
                ],
            ],
+2 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ class RoleController extends AbstractActionController {
        }

        $view = new ViewModel();
        $view->setTemplate('unicaen-utilisateur/default/form-role');
        $view->setTemplate('unicaen-utilisateur/role/template/form-role');
        $view->setVariables([
            'title' => 'Ajout d\'un nouveau rôle',
            'form' => $form,
@@ -127,7 +127,7 @@ class RoleController extends AbstractActionController {
        }

        $view = new ViewModel();
        $view->setTemplate('unicaen-utilisateur/default/form-role');
        $view->setTemplate('unicaen-utilisateur/role/template/form-role');
        $view->setVariables([
            'title' => "Modification du rôle",
            'form' => $form,
+9 −6
Original line number Diff line number Diff line
@@ -8,17 +8,21 @@ use UnicaenUtilisateur\Service\Role\RoleService;

class RoleControllerFactory {

    public function __invoke(ContainerInterface $container)
    /**
     * Create controller
     *
     * @param ContainerInterface $container
     * @param string $requestedName
     * @param array|null $options
     * @return RoleController|object
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        /**
         * @var RoleService $roleService
         */
        $roleService = $container->get(RoleService::class);
        $config = $container->get('Config');

        /**
         * @var RoleForm $roleForm
         */
        $roleForm = $container->get('FormElementManager')->get(RoleForm::class);

        $identityProvider = null;
@@ -29,7 +33,6 @@ class RoleControllerFactory {
            }
        }

        /** @var RoleController $controller */
        $controller = new RoleController();
        $controller->setIdentityProvider($identityProvider);
        $controller->setRoleService($roleService);
+4 −4
Original line number Diff line number Diff line
@@ -162,8 +162,8 @@ class UtilisateurController extends AbstractActionController
        return new JsonModel([
            "result" => $result ?: false,
            "message" => $result
                ? sprintf("Ajout du rôle \"%s\" à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                : sprintf("Erreur lors de l'ajout du rôle \"%s\" à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                ? sprintf("Ajout du rôle <strong>%s</strong> à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                : sprintf("Erreur lors de l'ajout du rôle <strong>%s</strong> à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
        ]);
    }

@@ -181,8 +181,8 @@ class UtilisateurController extends AbstractActionController
        return new JsonModel([
            "result" => $result ?: false,
            "message" => $result
                ? sprintf("Suppression du rôle \"%s\" à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                : sprintf("Erreur lors de la suppression du rôle \"%s\" à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                ? sprintf("Suppression du rôle <strong>%s</strong> à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
                : sprintf("Erreur lors de la suppression du rôle <strong>%s</strong> à l'utilisateur <strong>%s</strong>.", $role->getLibelle(), $utilisateur->getDisplayName())
        ]);
    }

+11 −7
Original line number Diff line number Diff line
@@ -11,9 +11,18 @@ use UnicaenUtilisateur\Service\RechercheIndividu\RechercheIndividuServiceInterfa
use UnicaenUtilisateur\Service\Role\RoleService;
use UnicaenUtilisateur\Service\User\UserService;

class UtilisateurControllerFactory {
class UtilisateurControllerFactory
{

    public function __invoke(ContainerInterface $container)
    /**
     * Create controller
     *
     * @param ContainerInterface $container
     * @param string $requestedName
     * @param array|null $options
     * @return UtilisateurController|object
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        /**
         * @var RoleService $roleService
@@ -23,11 +32,6 @@ class UtilisateurControllerFactory {
        $moduleConfig = $config['unicaen-utilisateur'];
        $roleService = $container->get(RoleService::class);
        $userService = $container->get(UserService::class);

        /**
         * @var UserForm $userForm
         * @var UserRechercheForm $userRechercheForm
         */
        $userForm = $container->get('FormElementManager')->get(UserForm::class);
        $userRechercheForm = $container->get('FormElementManager')->get(UserRechercheForm::class);

Loading