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

Merge branch 'local-auth'

parents ca921e67 d84d6b2d
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
<?php
/**
 * Affichage d'un avertissement concernant la mise à jour nécessaire du scema de BDD
 * depuis l'ajout de la fonctionnalité 'mot de passe oublié'.
 */

//require '../../../autoload.php';

$message = <<<EOS
/*******************************************************************
 *                       ! ATTENTION !
 *
 * Si vous installez cette version d'unicaen/auth, vous devez 
 * vous assurer que la colonne PASSWORD_RESET_TOKEN existe bien 
 * dans votre table utilisateur (nommee USER par défaut).
 * Si ce n'est pas le cas, utilisez ceci pour l'ajouter :
 *
 *    alter table "USER" add PASSWORD_RESET_TOKEN varchar2(256);
 *    create unique index USER_PASSWORD_RESET_TOKEN_UN on "USER"(PASSWORD_RESET_TOKEN);
 * 
 ******************************************************************/

EOS;

echo $message;
readline("Appuyez sur entrée pour pousuivre le processus 'composer' ou CTRL-C pour abandonner... ");
echo PHP_EOL;
+5 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@
        "unicaen/app":                                  "^1.3",
        "zf-commons/zfc-user-doctrine-orm":             ">=0.1",
        "jasig/phpcas":                                 ">=1.3.3",
        "bjyoungblood/bjy-authorize":                   ">=1.4"
        "bjyoungblood/bjy-authorize":                   ">=1.4",
        "ramsey/uuid":                                  "^3.8"
    },
    "require-dev": {
        "phpunit/PHPUnit":                              ">=3.7"
@@ -24,5 +25,8 @@
        "classmap": [
            "./Module.php"
        ]
    },
    "scripts": {
        "pre-update-cmd": "@php bin/password-reset-requires-schema-update-warning.php"
    }
}
 No newline at end of file
+34 −0
Original line number Diff line number Diff line
@@ -5,12 +5,24 @@ use UnicaenAuth\Controller\AuthControllerFactory;
use UnicaenAuth\Service\ShibService;
use UnicaenAuth\Service\ShibServiceFactory;
use UnicaenAuth\Service\UserContextFactory;
use UnicaenAuth\Service\UserMapperFactory;
use UnicaenAuth\View\Helper\LdapConnectViewHelperFactory;
use UnicaenAuth\View\Helper\LocalConnectViewHelperFactory;
use UnicaenAuth\View\Helper\ShibConnectViewHelperFactory;
use UnicaenAuth\View\Helper\UserUsurpationHelperFactory;

$settings = [

    /**
     * Configuration de l'authentification locale.
     */
    'local' => [
        /**
         * Possibilité ou non de s'authentifier à l'aide d'un compte local.
         */
        'enabled' => true,
    ],

    /**
     * Configuration de l'authentification LDAP.
     */
@@ -143,6 +155,8 @@ return [
                ['controller' => 'UnicaenAuth\Controller\Utilisateur', 'action' => 'selectionner-profil', 'roles' => []],

                ['controller' => 'UnicaenAuth\Controller\Auth', 'action' => 'shibboleth', 'roles' => []],
                ['controller' => 'UnicaenAuth\Controller\Auth', 'action' => 'requestPasswordReset', 'roles' => []],
                ['controller' => 'UnicaenAuth\Controller\Auth', 'action' => 'changePassword', 'roles' => []],
            ],
        ],
    ],
@@ -210,6 +224,24 @@ return [
                            ],
                        ],
                    ],
                    'requestPasswordReset' => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/request-password-reset',
                            'defaults' => [
                                'action'     => 'requestPasswordReset',
                            ],
                        ],
                    ],
                    'changePassword' => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/change-password/:token',
                            'defaults' => [
                                'action'     => 'changePassword',
                            ],
                        ],
                    ],
                ],
            ],
            'zfcuser'     => [
@@ -417,6 +449,7 @@ return [
            'zfcuser_redirect_callback'                => 'UnicaenAuth\Authentication\RedirectCallbackFactory', // substituion
            ShibService::class                         => ShibServiceFactory::class,
            'UnicaenAuth\Service\UserContext'          => UserContextFactory::class,
            'zfcuser_user_mapper'                      => UserMapperFactory::class,
            'MouchardCompleterAuth'        => 'UnicaenAuth\Mouchard\MouchardCompleterAuthFactory',
        ],
        'shared' => [
@@ -453,6 +486,7 @@ return [
            'userProfileSelect'          => 'UnicaenAuth\View\Helper\UserProfileSelectFactory',
            'userProfileSelectRadioItem' => 'UnicaenAuth\View\Helper\UserProfileSelectRadioItemFactory',
            'userUsurpation'             => UserUsurpationHelperFactory::class,
            'localConnect'               => LocalConnectViewHelperFactory::class,
            'ldapConnect'                => LdapConnectViewHelperFactory::class,
            'shibConnect'                => ShibConnectViewHelperFactory::class,
        ],
+10 −0
Original line number Diff line number Diff line
@@ -7,6 +7,16 @@
 */
$settings = [

    /**
     * Configuration de l'authentification locale.
     */
    'local' => [
        /**
         * Possibilité ou non de s'authentifier à l'aide d'un compte local.
         */
        'enabled' => true,
    ],

    /**
     * Configuration de l'authentification LDAP.
     */
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ CREATE TABLE user (
  UNIQUE INDEX `unique_username` (`username` ASC)
) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;

alter table user add PASSWORD_RESET_TOKEN varchar2(256) default null;

create unique index USER_PASSWORD_RESET_TOKEN_UN on user (PASSWORD_RESET_TOKEN);


CREATE TABLE IF NOT EXISTS `user_role` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
Loading