From 662088d3b367d419c5861e992913b29ed830f316 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 2 Apr 2024 05:43:01 +0200 Subject: [PATCH] Enable register captcha --- Controller/UserController.php | 2 ++ Form/RegisterType.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Controller/UserController.php b/Controller/UserController.php index 73f02ea..4058c91 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -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 diff --git a/Form/RegisterType.php b/Form/RegisterType.php index 09eea5c..00c17b2 100644 --- a/Form/RegisterType.php +++ b/Form/RegisterType.php @@ -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]); -- 2.41.1