Merge pull request #4426 from christianbeeznest/ofaj-20286

Contact - Add captcha in contact form - refs BT#20286
pull/4574/head
Nicolas Ducoulombier 3 years ago committed by GitHub
commit c480b975e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/AppKernel.php
  2. 2
      app/config/config.yml
  3. 3
      composer.json
  4. 7
      src/Chamilo/ContactBundle/Form/Type/ContactType.php

@ -128,7 +128,8 @@ class AppKernel extends Kernel
/*new Bazinga\Bundle\FakerBundle\BazingaFakerBundle(),
//new Chamilo\CmsBundle\ChamiloCmsBundle(),
*/
new Lunetics\LocaleBundle\LuneticsLocaleBundle()
new Lunetics\LocaleBundle\LuneticsLocaleBundle(),
new Gregwar\CaptchaBundle\GregwarCaptchaBundle()
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {

@ -283,7 +283,7 @@ knp_menu:
# client_id: <client_id>
# client_secret: <client_secret>
#gregwar_captcha:
gregwar_captcha: ~
# Doctrine audit
sonata_doctrine_orm_admin:

@ -156,7 +156,8 @@
"symfony/dom-crawler": "~2.8",
"brumann/polyfill-unserialize": "^1.0",
"yuloh/bccomp-polyfill": "dev-master",
"thenetworg/oauth2-azure": "^1.4"
"thenetworg/oauth2-azure": "^1.4",
"gregwar/captcha-bundle": "2.0"
},
"require-dev": {
"behat/behat": "@stable",

@ -3,6 +3,7 @@
namespace Chamilo\ContactBundle\Form\Type;
use Gregwar\CaptchaBundle\Type\CaptchaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@ -40,6 +41,12 @@ class ContactType extends AbstractType
->add('message', 'textarea')
// Ofaj
->add('gdpr_checkbox', CheckboxType::class, ['mapped' => false])
->add('captcha', CaptchaType::class,
[
'width' => 200,
'height' => 50,
'length' => 6
])
/*->add(
'gdpr_textarea',
'textarea',

Loading…
Cancel
Save