]> Raphaël G. Git Repositories - userbundle/commitdiff
Enable register captcha master 0.5.0
authorRaphaël Gertz <git@rapsys.eu>
Tue, 2 Apr 2024 03:43:01 +0000 (05:43 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 2 Apr 2024 03:43:07 +0000 (05:43 +0200)
Controller/UserController.php
Form/RegisterType.php

index 73f02ea03c446ebea2195177d259049287be597f..4058c9134d0efaef194fde84926053dedf46244b 100644 (file)
@@ -583,6 +583,8 @@ class UserController extends AbstractController {
                $form = $this->factory->create($this->config['register']['view']['form'], $user, [
                        //Set action to register route name and context
                        'action' => $this->generateUrl($this->config['route']['register']['name'], $this->config['route']['register']['context']),
+                       //Set captcha
+                       'captcha' => true,
                        //Set civility class
                        'civility_class' => $this->config['class']['civility'],
                        //Set civility default
index 09eea5c6bf4eddf403e3853bd416ed6e6c0a41e3..00c17b2d53c173f53d07d8fd8c7d6fab48e6b3b1 100644 (file)
@@ -87,6 +87,9 @@ class RegisterType extends CaptchaType {
         * {@inheritdoc}
         */
        public function configureOptions(OptionsResolver $resolver): void {
+               //Call parent configure options
+               parent::configureOptions($resolver);
+
                //Set defaults
                $resolver->setDefaults(['error_bubbling' => true, 'civility' => true, 'civility_class' => 'RapsysUserBundle:Civility', 'civility_default' => null, 'mail' => true, 'password' => true, 'password_repeated' => true, 'forename' => true, 'surname' => true, 'active' => false, 'enable' => false]);