Commit 26bbf267 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'local-auth' into develop

parents f0cae88a 78654bd6
Loading
Loading
Loading
Loading
+1 −1
Changes for composer.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
        "ext-json":                             "*",
        "ext-imagick":                          "*",
        "unicaen/app":                          "^1.3",
        "unicaen/auth":                         "^1.2",
        "unicaen/auth":                         "^1.3",
        "unicaen/faq":                          "^1.0",
        "unicaen/ldap":                         "^2.1",
        "unicaen/import":                       "1.0.13",
+79 −13
Changes for composer.lock: 79 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "946a5ea1f43e05305f62da7f28d3b592",
    "content-hash": "544dc6ec23d299678ca49734acb51b65",
    "packages": [
        {
            "name": "beberlei/assert",
@@ -1442,21 +1442,22 @@
        },
        {
            "name": "ramsey/uuid",
            "version": "3.7.3",
            "version": "3.8.0",
            "source": {
                "type": "git",
                "url": "https://github.com/ramsey/uuid.git",
                "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76"
                "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
                "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76",
                "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3",
                "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3",
                "shasum": ""
            },
            "require": {
                "paragonie/random_compat": "^1.0|^2.0",
                "php": "^5.4 || ^7.0"
                "paragonie/random_compat": "^1.0|^2.0|9.99.99",
                "php": "^5.4 || ^7.0",
                "symfony/polyfill-ctype": "^1.8"
            },
            "replace": {
                "rhumsaa/uuid": "self.version"
@@ -1464,16 +1465,17 @@
            "require-dev": {
                "codeception/aspect-mock": "^1.0 | ~2.0.0",
                "doctrine/annotations": "~1.2.0",
                "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1",
                "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0",
                "ircmaxell/random-lib": "^1.1",
                "jakub-onderka/php-parallel-lint": "^0.9.0",
                "mockery/mockery": "^0.9.9",
                "moontoast/math": "^1.1",
                "php-mock/php-mock-phpunit": "^0.3|^1.1",
                "phpunit/phpunit": "^4.7|^5.0",
                "phpunit/phpunit": "^4.7|^5.0|^6.5",
                "squizlabs/php_codesniffer": "^2.3"
            },
            "suggest": {
                "ext-ctype": "Provides support for PHP Ctype functions",
                "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator",
                "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator",
                "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
@@ -1518,7 +1520,7 @@
                "identifier",
                "uuid"
            ],
            "time": "2018-01-20T00:28:24+00:00"
            "time": "2018-07-19T23:38:55+00:00"
        },
        {
            "name": "rwoverdijk/assetmanager",
@@ -1754,6 +1756,64 @@
            "homepage": "https://symfony.com",
            "time": "2018-05-16T14:03:39+00:00"
        },
        {
            "name": "symfony/polyfill-ctype",
            "version": "v1.10.0",
            "source": {
                "type": "git",
                "url": "https://github.com/symfony/polyfill-ctype.git",
                "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
                "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
                "shasum": ""
            },
            "require": {
                "php": ">=5.3.3"
            },
            "suggest": {
                "ext-ctype": "For best performance"
            },
            "type": "library",
            "extra": {
                "branch-alias": {
                    "dev-master": "1.9-dev"
                }
            },
            "autoload": {
                "psr-4": {
                    "Symfony\\Polyfill\\Ctype\\": ""
                },
                "files": [
                    "bootstrap.php"
                ]
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Symfony Community",
                    "homepage": "https://symfony.com/contributors"
                },
                {
                    "name": "Gert de Pagter",
                    "email": "backendtea@gmail.com"
                }
            ],
            "description": "Symfony polyfill for ctype functions",
            "homepage": "https://symfony.com",
            "keywords": [
                "compatibility",
                "ctype",
                "polyfill",
                "portable"
            ],
            "time": "2018-08-06T14:22:27+00:00"
        },
        {
            "name": "symfony/polyfill-mbstring",
            "version": "v1.8.0",
@@ -1915,15 +1975,16 @@
        },
        {
            "name": "unicaen/auth",
            "version": "1.2.18",
            "version": "1.3.0",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/auth.git",
                "reference": "87c6802dfadfcdc8b05602607ea69b959c1ec063"
                "reference": "3734df0f0bca8fdb4f7879e7ee38c65e94a8c09a"
            },
            "require": {
                "bjyoungblood/bjy-authorize": ">=1.4",
                "jasig/phpcas": ">=1.3.3",
                "ramsey/uuid": "^3.7",
                "unicaen/app": "^1.3",
                "zf-commons/zfc-user-doctrine-orm": ">=0.1"
            },
@@ -1940,8 +2001,13 @@
                    "./Module.php"
                ]
            },
            "scripts": {
                "pre-update-cmd": [
                    "@php bin/password-reset-requires-schema-update-warning.php"
                ]
            },
            "description": "Module d'authentification pour les applications Unicaen",
            "time": "2018-11-19T16:04:53+00:00"
            "time": "2019-01-24T12:36:36+00:00"
        },
        {
            "name": "unicaen/code",
+28 −18
Changes for module/Application/config/others/utilisateur.config.php: 28 added lines, 18 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@

use Application\Controller\Factory\UtilisateurControllerFactory;
use Application\Form\CreationUtilisateurForm;
use Application\Form\CreationUtilisateurFromIndividuForm;
use Application\Form\Factory\CreationUtilisateurFormFactory;
use Application\Form\Factory\CreationUtilisateurFromIndividuFormFactory;
use Application\Form\Factory\CreationUtilisateurHydratorFactory;
use Application\Form\Hydrator\CreationUtilisateurHydrator;
use Application\Form\Validator\Factory\NewEmailValidatorFactory;
@@ -39,7 +41,8 @@ return [
                    'action'     => [
                        'retirer-role',
                        'ajouter-role',
                        'creation-utilisateur',
                        'ajouter',
                        'ajouterFromIndividu',
                    ],
                    'privileges' => UtilisateurPrivileges::UTILISATEUR_MODIFICATION,
                ],
@@ -48,18 +51,6 @@ return [
    ],
    'router'          => [
        'routes' => [
            'creation-utilisateur' => [
                'type'          => Literal::class,
                'options'       => [
                    'route'       => '/creation-utilisateur',
                    'defaults'    => [
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Utilisateur',
                        'action' => 'creation-utilisateur',
                    ],
                ],
                'may_terminate' => true,
            ],
            'utilisateur' => [
                'type'          => Segment::class,
                'options'       => [
@@ -74,6 +65,24 @@ return [
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'ajouter' => [
                        'type'          => Literal::class,
                        'options'       => [
                            'route'       => '/ajouter',
                            'defaults'    => [
                                'action' => 'ajouter',
                            ],
                        ],
                    ],
                    'ajouter-pour-individu' => [
                        'type'          => Segment::class,
                        'options'       => [
                            'route'       => '/ajouter-pour-individu/:individu',
                            'defaults'    => [
                                'action' => 'ajouterFromIndividu',
                            ],
                        ],
                    ],
                    'rechercher-people' => [
                        'type'          => Segment::class,
                        'options'       => [
@@ -121,7 +130,7 @@ return [
                'pages' => [
                    'admin' => [
                        'pages' => [
                            'utilisateur' => [
                            'index' => [
                                'label'    => 'Utilisateurs',
                                'route'    => 'utilisateur',
                                'resource' => PrivilegeController::getResourceId('Application\Controller\Utilisateur', 'index'),
@@ -129,9 +138,9 @@ return [
                                'order'    => 60,
                            ],
                            'creation' => [
                                'label'    => 'Création d\'utilisateur',
                                'route'    => 'creation-utilisateur',
                                'resource' => PrivilegeController::getResourceId('Application\Controller\Utilisateur', 'creation-utilisateur'),
                                'label'    => "Création d'utilisateur",
                                'route'    => 'utilisateur/ajouter',
                                'resource' => PrivilegeController::getResourceId('Application\Controller\Utilisateur', 'ajouter'),

                                'order'    => 50,
                            ],
@@ -158,7 +167,8 @@ return [
    ],
    'form_elements' => [
        'factories' => [
            CreationUtilisateurForm::class => CreationUtilisateurFormFactory::class
            CreationUtilisateurForm::class => CreationUtilisateurFormFactory::class,
            CreationUtilisateurFromIndividuForm::class => CreationUtilisateurFromIndividuFormFactory::class,
        ]
    ],
    'hydrators' => [
+11 −9
Changes for module/Application/src/Application/Authentication/Storage/AppStorage.php: 11 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Application\Authentication\Storage;
use Application\Entity\Db\Doctorant;
use Application\Entity\Db\Utilisateur;
use Application\Entity\UserWrapper;
use Application\Entity\UserWrapperFactory;
use Application\Service\Doctorant\DoctorantServiceAwareTrait;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\Utilisateur\UtilisateurServiceAwareTrait;
@@ -46,19 +47,20 @@ class AppStorage implements ChainableStorage
     */
    public function read(ChainEvent $e)
    {
        $this->userWrapper = UserWrapper::instFromStorageChainEvent($e);
        $userWrapperFactory = new UserWrapperFactory();
        $this->userWrapper = $userWrapperFactory->createInstanceFromStorageChainEvent($e);
        if ($this->userWrapper === null) {
            return;
        }

        // pas la peine d'aller plus loin si l'établissement correspondant au domaine n'existe pas
        $domaineEtab = $this->userWrapper->getDomainFromEppn();
        $etablissement = $this->getEtablissementService()->getRepository()->findOneByDomaine($domaineEtab);
        if (! $etablissement) {
            throw new RuntimeException(
                "Les données concernant l'utilisateur authentifié font référence au domaine '$domaineEtab' " .
                "mais aucun établissement n'a été trouvé avec ce domaine.");
        }
//        // pas la peine d'aller plus loin si l'établissement correspondant au domaine n'existe pas
//        $domaineEtab = $this->userWrapper->getDomainFromEppn();
//        $etablissement = $this->getEtablissementService()->getRepository()->findOneByDomaine($domaineEtab);
//        if (! $etablissement) {
//            throw new RuntimeException(
//                "Les données concernant l'utilisateur authentifié font référence au domaine '$domaineEtab' " .
//                "mais aucun établissement n'a été trouvé avec ce domaine.");
//        }

        /**
         * Collecte des données issues de la table Utilisateur.
+3 −3
Changes for module/Application/src/Application/Controller/SubstitutionController.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ use Application\Entity\Db\Structure;
use Application\Entity\Db\StructureConcreteInterface;
use Application\Entity\Db\StructureInterface;
use Application\Entity\Db\TypeStructure;
use Application\Filter\EtablissementPrefixFilterAwareTrait;
use Application\SourceCodeStringHelperAwareTrait;
use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\Structure\StructureServiceAwareTrait;
@@ -21,7 +21,7 @@ class SubstitutionController extends AbstractController
    use EcoleDoctoraleServiceAwareTrait;
    use UniteRechercheServiceAwareTrait;
    use StructureServiceAwareTrait;
    use EtablissementPrefixFilterAwareTrait;
    use SourceCodeStringHelperAwareTrait;

    const CODE_SYGAL = 'SyGAL';

@@ -253,7 +253,7 @@ class SubstitutionController extends AbstractController

        if ($cible === null) {
            $cible = $this->getStructureService()->createStructureConcrete($type);
            $cible->setSourceCode($this->getEtablissementPrefixFilter()->addPrefixEtablissementTo($identifiant));
            $cible->setSourceCode($this->getSourceCodeStringHelper()->addPrefixEtablissementTo($identifiant));
        }

        $vm = new ViewModel();
Loading