[04/03/2023] Ajout du module ReCaptcha et config

This commit is contained in:
2023-03-04 21:47:58 +01:00
parent 437bd2bf4f
commit 533e3439c6
24 changed files with 886 additions and 15 deletions

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://thelia.net/schema/dic/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<loops>
<!-- sample definition
<loop name="MySuperLoop" class="ReCaptcha\Loop\MySuperLoop" />
-->
</loops>
<forms>
<form name="recaptcha_configuration.form" class="ReCaptcha\Form\ConfigurationForm" />
</forms>
<commands>
<!--
<command class="ReCaptcha\Command\MySuperCommand" />
-->
</commands>
<services>
<service id="recpatcha.action" class="ReCaptcha\Action\ReCaptchaAction">
<tag name="kernel.event_subscriber" />
<argument type="service" id="request"/>
</service>
<service id="thelia.form_validator" class="ReCaptcha\Form\MyTheliaFormValidator">
<argument type="service" id="thelia.translator" />
<argument>%kernel.environment%</argument>
<argument type="service" id="event_dispatcher" />
</service>
<service id="recpatcha.action.contact" class="ReCaptcha\EventListeners\ContactFormListener">
<tag name="kernel.event_subscriber" />
</service>
</services>
<hooks>
<hook id="recaptcha.hook" class="ReCaptcha\Hook\HookManager">
<tag name="hook.event_listener" event="main.head-top" type="front" method="loadRecaptcha" />
<tag name="hook.event_listener" event="recaptcha.js" type="front" method="loadRecaptcha" />
<tag name="hook.event_listener" event="recaptcha.check" type="front" method="addRecaptchaCheck" />
<tag name="hook.event_listener" event="contact.form-bottom" type="front" method="addRecaptchaCheckContact" />
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfigure" />
</hook>
</hooks>
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://thelia.net/schema/dic/module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
<fullnamespace>ReCaptcha\ReCaptcha</fullnamespace>
<descriptive locale="en_US">
<title>ReCaptcha</title>
</descriptive>
<descriptive locale="fr_FR">
<title>ReCaptcha</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.0.4</version>
<authors>
<author>
<name>Vincent Lopes-Vicente</name>
<email>vlopes@openstudio.fr</email>
</author>
</authors>
<type>classic</type>
<thelia>2.3.0</thelia>
<stability>other</stability>
</module>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="admin.recaptcha.config.save" path="/admin/module/recaptcha/configuration" methods="POST">
<default key="_controller">ReCaptcha\Controller\ConfigurationController::saveAction</default>
</route>
</routes>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../vendor/propel/propel/resources/xsd/database.xsd" >
<!--
See propel documentation on http://propelorm.org for all information about schema file
<table name="product_rel" namespace="ReCaptcha\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column defaultValue="0" name="visible" required="true" type="TINYINT" />
<column defaultValue="0" name="position" required="true" type="INTEGER" />
<column name="title" size="255" type="VARCHAR" />
<column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="product" name="fk_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
<behavior name="timestampable" />
<behavior name="i18n">
<parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
</behavior>
<behavior name="versionable">
<parameter name="log_created_at" value="true" />
<parameter name="log_created_by" value="true" />
</behavior>
</table>
-->
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>