module.config.php 5.6 KB
Newer Older
Bertrand Gauthier's avatar
Bertrand Gauthier committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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,
41
    /**     
Bertrand Gauthier's avatar
Bertrand Gauthier committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
     * 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\Cas',
//        200 => 'UnicaenAuth\Authentication\Adapter\Ldap',
////        100 => 'UnicaenAuth\Authentication\Adapter\Db',
//    ),
);

return array(
    'zfcuser' => $zfcuserSettings,
    'unicaen-auth' => $settings,
64
65
66
67
68
    'controllers' => array(
        'invokables' => array(
            'unicaen-auth' => 'UnicaenAuth\Controller\UtilisateurController',
        ),
    ),
Bertrand Gauthier's avatar
Bertrand Gauthier committed
69
70
    'view_manager' => array(
        'template_path_stack' => array(
71
            'unicaen-auth' => __DIR__ . '/../view',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
        ),
    ),
    'translator' => array(
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'router' => array(
        'routes' => array(
            'unicaen-auth' => array(
                'type' => 'Literal',
                'priority' => 2000,
                'options' => array(
                    'route' => '/utilisateur/generer-sesame',
                    'defaults' => array(
91
                        'controller' => 'unicaen-auth',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
                        'action'     => 'generer-sesame',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'query' => array(
                        'type' => 'Query',
                    ),
                ),
            ),
            'zfcuser' => array(
                'type' => 'Literal',
                'priority' => 1000,
                'options' => array(
                    'route' => '/utilisateur',
                    '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(
146
                        'label'    => _("Se connecter"),
Bertrand Gauthier's avatar
Bertrand Gauthier committed
147
148
149
150
                        'route'    => 'zfcuser/login',
                        'visible'  => false,
                    ),
                    'register' => array(
151
                        'label'   => _("S'enregistrer"),
Bertrand Gauthier's avatar
Bertrand Gauthier committed
152
153
154
155
156
157
158
159
                        'route'   => 'zfcuser/register',
                        'visible' => false,
                    ),
                ),
            ),
        ),
    ),
);