Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"doctrine/orm": "^3.6",
"drewm/mailchimp-api": "^2.5",
"erusev/parsedown": "^1.8",
"excelwebzone/recaptcha-bundle": "^1.5",
"geocoder-php/google-maps-provider": "^4.8",
"jms/serializer-bundle": "^5.5",
"knpuniversity/oauth2-client-bundle": "^2.20",
Expand Down
118 changes: 2 additions & 116 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
AppBundle\AppBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true],
EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class => ['all' => true],
Tiime\NewRelicBundle\TiimeNewRelicBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Expand Down
7 changes: 0 additions & 7 deletions config/packages/ewz_recaptcha.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions config/packages/recaptcha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
app.recaptcha.enabled: true

when@test:
parameters:
app.recaptcha.enabled: false
31 changes: 0 additions & 31 deletions config/reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -1494,33 +1494,6 @@
* i18n?: "symfony"|"jms"|Param, // Strategy used to create your i18n routes. // Default: "symfony"
* },
* }
* @psalm-type EwzRecaptchaConfig = array{
* public_key?: scalar|Param|null,
* private_key?: scalar|Param|null,
* enabled?: bool|Param, // Default: true
* verify_host?: bool|Param, // Default: false
* ajax?: bool|Param, // Default: false
* locale_key?: scalar|Param|null, // Default: "%kernel.default_locale%"
* api_host?: scalar|Param|null, // Default: "www.google.com"
* locale_from_request?: bool|Param, // Default: false
* version?: int|Param, // Default: 2
* hide_badge?: bool|Param, // Default: false
* score_threshold?: float|Param, // Default: 0.5
* timeout?: int|Param, // Default: null
* trusted_roles?: list<scalar|Param|null>,
* http_proxy?: array{
* host?: scalar|Param|null, // Default: null
* port?: scalar|Param|null, // Default: null
* auth?: scalar|Param|null, // Default: null
* },
* service_definition?: list<array{ // Default: []
* service_name?: scalar|Param|null,
* options?: array{
* action_name?: scalar|Param|null,
* script_nonce_csp?: scalar|Param|null,
* },
* }>,
* }
* @psalm-type TiimeNewRelicConfig = array{
* enabled?: bool|Param, // Default: true
* interactor?: scalar|Param|null,
Expand Down Expand Up @@ -1835,7 +1808,6 @@
* knpu_oauth2_client?: KnpuOauth2ClientConfig,
* jms_serializer?: JmsSerializerConfig,
* presta_sitemap?: PrestaSitemapConfig,
* ewz_recaptcha?: EwzRecaptchaConfig,
* tiime_new_relic?: TiimeNewRelicConfig,
* valinor?: ValinorConfig,
* doctrine?: DoctrineConfig,
Expand All @@ -1856,7 +1828,6 @@
* knpu_oauth2_client?: KnpuOauth2ClientConfig,
* jms_serializer?: JmsSerializerConfig,
* presta_sitemap?: PrestaSitemapConfig,
* ewz_recaptcha?: EwzRecaptchaConfig,
* tiime_new_relic?: TiimeNewRelicConfig,
* debug?: DebugConfig,
* web_profiler?: WebProfilerConfig,
Expand All @@ -1880,7 +1851,6 @@
* knpu_oauth2_client?: KnpuOauth2ClientConfig,
* jms_serializer?: JmsSerializerConfig,
* presta_sitemap?: PrestaSitemapConfig,
* ewz_recaptcha?: EwzRecaptchaConfig,
* tiime_new_relic?: TiimeNewRelicConfig,
* valinor?: ValinorConfig,
* doctrine?: DoctrineConfig,
Expand All @@ -1902,7 +1872,6 @@
* knpu_oauth2_client?: KnpuOauth2ClientConfig,
* jms_serializer?: JmsSerializerConfig,
* presta_sitemap?: PrestaSitemapConfig,
* ewz_recaptcha?: EwzRecaptchaConfig,
* tiime_new_relic?: TiimeNewRelicConfig,
* debug?: DebugConfig,
* web_profiler?: WebProfilerConfig,
Expand Down
11 changes: 2 additions & 9 deletions sources/AppBundle/Association/Form/CompanyMemberType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
use AppBundle\Association\CompanyMembership\SubscriptionManagement;
use AppBundle\Association\Entity\CompanyMemberInvitation;
use AppBundle\Association\Entity\CompanyMember;
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaIsValid;
use AppBundle\Recaptcha\RecaptchaType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
Expand Down Expand Up @@ -118,13 +117,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}),
],
])
->add('recaptcha', EWZRecaptchaType::class, [
'label' => false,
'mapped' => false,
'constraints' => [
new RecaptchaIsValid(),
],
])
->add('recaptcha', RecaptchaType::class, ['label' => false])
->add('save', SubmitType::class, ['label' => 'saveMembership'])
;

Expand Down
11 changes: 2 additions & 9 deletions sources/AppBundle/Event/Form/LeadType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
namespace AppBundle\Event\Form;

use AppBundle\Event\Model\Lead;
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaIsValid;
use AppBundle\Recaptcha\RecaptchaType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
Expand All @@ -31,13 +30,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'choices' => ['fr' => 'fr', 'en' => 'en'],
'multiple' => false,
])
->add('recaptcha', EWZRecaptchaType::class, [
'label' => 'Vérification',
'mapped' => false,
'constraints' => [
new RecaptchaIsValid(),
],
])
->add('recaptcha', RecaptchaType::class, ['label' => 'Vérification'])
;
}

Expand Down
11 changes: 2 additions & 9 deletions sources/AppBundle/Event/Form/SpeakerSuggestionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

namespace AppBundle\Event\Form;

use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaIsValid;
use AppBundle\Recaptcha\RecaptchaType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
Expand Down Expand Up @@ -66,13 +65,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
],
],
)
->add('recaptcha', EWZRecaptchaType::class, [
'label' => 'Vérification',
'mapped' => false,
'constraints' => [
new RecaptchaIsValid(),
],
])
->add('recaptcha', RecaptchaType::class, ['label' => 'Vérification'])
->add('save', SubmitType::class, ['label' => 'Suggérer'])
;
}
Expand Down
19 changes: 19 additions & 0 deletions sources/AppBundle/Recaptcha/IsValidRecaptcha.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace AppBundle\Recaptcha;

use Symfony\Component\Validator\Constraint;

#[\Attribute]
class IsValidRecaptcha extends Constraint
{
public string $message = 'This value is not a valid captcha.';

#[\Override]
public function getTargets(): string
{
return self::PROPERTY_CONSTRAINT;
}
}
Loading
Loading