| Conditions | 2 |
| Paths | 1 |
| Total Lines | 38 |
| Code Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function getConfigTreeBuilder(): TreeBuilder |
||
| 23 | { |
||
| 24 | $treeBuilder = new TreeBuilder('zikula_users'); |
||
| 25 | |||
| 26 | $treeBuilder->getRootNode() |
||
| 27 | ->children() |
||
| 28 | ->booleanNode('allow_self_deletion') |
||
| 29 | ->info('Allow users to delete themselves.') |
||
| 30 | ->defaultFalse() |
||
| 31 | ->end() |
||
| 32 | ->arrayNode('registration') |
||
| 33 | ->info('Registration settings.') |
||
| 34 | ->addDefaultsIfNotSet() |
||
| 35 | ->children() |
||
| 36 | ->booleanNode('enabled') |
||
| 37 | ->info('Allow new user account registrations.') |
||
| 38 | ->defaultTrue() |
||
| 39 | ->end() |
||
| 40 | ->scalarNode('disabled_reason') |
||
| 41 | ->info('Statement displayed if registration disabled.') |
||
| 42 | ->defaultValue('Sorry! New user registration is currently disabled.') |
||
| 43 | ->end() |
||
| 44 | ->scalarNode('admin_notification_mail') |
||
| 45 | ->info('E-mail address to notify of registrations (leave blank for no notifications).') |
||
| 46 | ->defaultNull() |
||
| 47 | ->validate() |
||
| 48 | ->ifTrue(static function ($v) { |
||
| 49 | return null !== $v && !filter_var($v, FILTER_VALIDATE_EMAIL); |
||
| 50 | }) |
||
| 51 | ->thenInvalid('Please enter a valid mail address.') |
||
| 52 | ->end() |
||
| 53 | ->end() |
||
| 54 | ->end() |
||
| 55 | ->end() |
||
| 56 | ->end() |
||
| 57 | ; |
||
| 58 | |||
| 59 | return $treeBuilder; |
||
| 60 | } |
||
| 62 |