Skip to content
Snippets Groups Projects
Select Git revision
  • 4183602a67a8ed3b99d15a843b25f34b05bc3721
  • master default protected
  • 5.x
  • ll-php8-bs5
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
32 results

module.config.php

Blame
  • Bertrand Gauthier's avatar
    Bertrand Gauthier authored
    Amélioration/Refactorisation ; SUppression mot de passe sésame et remplacement par login au format loginUsurpateur=loginUsurpé.
    86a69410
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    module.config.php 9.43 KiB
    <?php
    $settings = array(
        
    );
    $zfcuserSettings = array(
        /**
         * Enable registration
         * Allows users to register through the website.
         * Accepted values: boolean true or false
         */
        'enable_registration' => true,
        /**
         * Modes for authentication identity match
         * Specify the allowable identity modes, in the order they should be
         * checked by the Authentication plugin.
         * Default value: array containing 'email'
         * Accepted values: array containing one or more of: email, username
         */
        'auth_identity_fields' => array('username'),
        /**
         * Login Redirect Route
         * Upon successful login the user will be redirected to the entered route
         * Default value: 'zfcuser'
         * Accepted values: A valid route name within your application
         */
        'login_redirect_route' => 'home',
        /**
         * Logout Redirect Route
         * Upon logging out the user will be redirected to the enterd route
         * Default value: 'zfcuser/login'
         * Accepted values: A valid route name within your application
         */
        'logout_redirect_route' => 'home',
        /**
         * Enable Username
         * Enables username field on the registration form, and allows users to log
         * in using their username OR email address. Default is false.
         * Accepted values: boolean true or false
         */
        'enable_username' => true,
        /**     
         * Enable Display Name
         * Enables a display name field on the registration form, which is persisted
         * in the database. Default value is false.
         * Accepted values: boolean true or false
         */
        'enable_display_name' => true,
        /**     
         * Authentication Adapters
         * Specify the adapters that will be used to try and authenticate the user
         * Default value: array containing 'ZfcUser\Authentication\Adapter\Db' with priority 100
         * Accepted values: array containing services that implement 'ZfcUser\Authentication\Adapter\ChainableAdapter'
         */
        'auth_adapters' => array(
            300 => 'UnicaenAuth\Authentication\Adapter\Ldap', // notifié en 1er
            200 => 'ZfcUser\Authentication\Adapter\Db',       //         ensuite (si échec d'authentification Ldap)
            100 => 'UnicaenAuth\Authentication\Adapter\Cas',  //         ensuite (si échec d'authentification Db)
        ),
    );
    $bjyauthorize = array(
        /* this module uses a meta-role that inherits from any roles that should
         * be applied to the active user. the identity provider tells us which
         * roles the "identity role" should inherit from.
         *
         * for ZfcUser, this will be your default identity provider
         */
        'identity_provider' => 'UnicaenAuth\Provider\Identity\LdapPeople',
        
        /* role providers simply provide a list of roles that should be inserted
         * into the Zend\Acl instance. the module comes with two providers, one
         * to specify roles in a config file and one to load roles using a
         * Zend\Db adapter.
         */
        'role_providers' => array(
            /* here, 'guest' and 'user are defined as top-level roles, with
             * 'admin' inheriting from user
             */
            'BjyAuthorize\Provider\Role\Config' => array(
                'guest' => array(), // rôle par défaut
    //            'user'  => array('children' => array(
    //                'admin' => array(),
    //            )),
            ),
        ),
    
        // strategy service name for the strategy listener to be used when permission-related errors are detected
        'unauthorized_strategy' => 'BjyAuthorize\View\RedirectionStrategy',
            
        /* Currently, only controller and route guards exist
         */
        'guards' => array(
            /* If this guard is specified here (i.e. it is enabled), it will block
             * access to all controllers and actions unless they are specified here.
             * You may omit the 'action' index to allow access to the entire controller
             */
            'BjyAuthorize\Guard\Controller' => array(
                array('controller' => 'index', 'action' => 'index',                                 'roles' => array('guest')),
                array('controller' => 'zfcuser',                                                    'roles' => array('guest')),
                array('controller' => 'Application\Controller\Index',                               'roles' => array('guest')),
    
                array('controller' => 'UnicaenApp\Controller\Application:etab',                     'roles' => array('guest')),
                array('controller' => 'UnicaenApp\Controller\Application:apropos',                  'roles' => array('guest')),
                array('controller' => 'UnicaenApp\Controller\Application:contact',                  'roles' => array('guest')),
                array('controller' => 'UnicaenApp\Controller\Application:plan',                     'roles' => array('guest')),
                array('controller' => 'UnicaenApp\Controller\Application:mentions-legales',         'roles' => array('guest')),
                array('controller' => 'UnicaenApp\Controller\Application:informatique-et-libertes', 'roles' => array('guest')),
            ),
        ),
    );
    
    return array(
        'zfcuser' => $zfcuserSettings,
        'bjyauthorize' => $bjyauthorize,
        'unicaen-auth' => $settings,
        'service_manager' => array(
            'abstract_factories' => array(
                'UnicaenAuth\Authentication\Adapter\AbstractFactory',
            ),
            'factories' => array(
                'unicaen-auth_module_options' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) {
                    $config = $serviceLocator->get('Config');
                    return new UnicaenAuth\Options\ModuleOptions(array_merge($config['zfcuser'], $config['unicaen-auth']));
                },
                'UnicaenAuth\Authentication\Storage\Db' => function() {
                    return new UnicaenAuth\Authentication\Storage\Db();
                },
                'UnicaenAuth\Authentication\Storage\Ldap' => function() {
                    return new UnicaenAuth\Authentication\Storage\Ldap();
                },
                'UnicaenAuth\Authentication\Storage\LdapDb' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) {
                    $storage = new UnicaenAuth\Authentication\Storage\LdapDb();
                    $storage->setLdapStorage($serviceLocator->get('UnicaenAuth\Authentication\Storage\Ldap'))
                            ->setDbStorage(  $serviceLocator->get('UnicaenAuth\Authentication\Storage\Db'));
                    return $storage;
                },
                'zfcuser_auth_service' => function (Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) {
                    return new \Zend\Authentication\AuthenticationService(
                        $serviceLocator->get('UnicaenAuth\Authentication\Storage\LdapDb'),
                        $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain')
                    );
                },
            ),
        ),
        'controllers' => array(
            'invokables' => array(
                'unicaen-auth' => 'UnicaenAuth\Controller\UtilisateurController',
            ),
        ),
        'view_manager' => array(
            'template_path_stack' => array(
                'unicaen-auth' => __DIR__ . '/../view',
            ),
        ),
        'translator' => array(
            'translation_file_patterns' => array(
                array(
                    'type'     => 'gettext',
                    'base_dir' => __DIR__ . '/../language',
                    'pattern'  => '%s.mo',
                ),
            ),
        ),
        'router' => array(
            'routes' => array(
                'zfcuser' => array(
                    'type' => 'Literal',
                    'priority' => 1000,
                    'options' => array(
                        'route' => '/auth',
                        'defaults' => array(
                            'controller' => 'zfcuser',
                            'action'     => 'index',
                        ),
                    ),
                    'may_terminate' => true,
                    'child_routes' => array(
                        'login' => array(
                            'type' => 'Literal',
                            'options' => array(
                                'route' => '/connexion',
                                'defaults' => array(
                                    'controller' => 'zfcuser',
                                    'action'     => 'login',
                                ),
                            ),
                        ),
                        'logout' => array(
                            'type' => 'Literal',
                            'options' => array(
                                'route' => '/deconnexion',
                                'defaults' => array(
                                    'controller' => 'zfcuser',
                                    'action'     => 'logout',
                                ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
        // All navigation-related configuration is collected in the 'navigation' key
        'navigation' => array(
            // The DefaultNavigationFactory we configured uses 'default' as the sitemap key
            'default' => array(
                // And finally, here is where we define our page hierarchy
                'home' => array(
                    'pages' => array(
                        'login' => array(
                            'label'    => _("Se connecter"),
                            'route'    => 'zfcuser/login',
                            'visible'  => false,
                        ),
                        'register' => array(
                            'label'   => _("S'enregistrer"),
                            'route'   => 'zfcuser/register',
                            'visible' => false,
                        ),
                    ),
                ),
            ),
        ),
    );