On réinstalle ReCaptcha, sans le "rearrange" de code de PhpStorm.

This commit is contained in:
2020-05-13 17:44:39 +02:00
parent 3ca18832f5
commit 66207959e2
8 changed files with 28 additions and 28 deletions

View File

@@ -18,13 +18,6 @@ class ReCaptchaAction implements EventSubscriberInterface
$this->request = $request;
}
public static function getSubscribedEvents()
{
return [
ReCaptchaEvents::CHECK_CAPTCHA_EVENT => ['checkCaptcha', 128],
];
}
public function checkCaptcha(ReCaptchaCheckEvent $event)
{
$requestUrl = "https://www.google.com/recaptcha/api/siteverify";
@@ -52,4 +45,11 @@ class ReCaptchaAction implements EventSubscriberInterface
$event->setHuman(true);
}
}
public static function getSubscribedEvents()
{
return [
ReCaptchaEvents::CHECK_CAPTCHA_EVENT => ['checkCaptcha', 128],
];
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://thelia.net/schema/dic/module"
<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">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://symfony.com/schema/routing"
<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" path="/admin/module/ReCaptcha">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultIdMethod="native"
name="thelia"
<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

View File

@@ -10,6 +10,13 @@ use Thelia\Core\Translation\Translator;
class ConfigurationController extends BaseAdminController
{
public function viewAction()
{
return $this->render(
"recaptcha/configuration"
);
}
public function saveAction()
{
if (null !== $response = $this->checkAuth(array(AdminResources::MODULE), 'ReCaptcha', AccessManager::VIEW)) {
@@ -40,11 +47,4 @@ class ConfigurationController extends BaseAdminController
return $this->generateSuccessRedirect($form);
}
public function viewAction()
{
return $this->render(
"recaptcha/configuration"
);
}
}

View File

@@ -8,11 +8,6 @@ use Thelia\Form\BaseForm;
class ConfigurationForm extends BaseForm
{
public function getName()
{
return "recaptcha_configuration_form";
}
protected function buildForm()
{
$this->formBuilder
@@ -52,4 +47,9 @@ class ConfigurationForm extends BaseForm
]
);
}
public function getName()
{
return "recaptcha_configuration_form";
}
}

View File

@@ -35,7 +35,7 @@
{/if}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path={navigate to="current"}}"/>
<input type="hidden" name="{$name}" value="{url path={navigate to="current"}}"/>
{/form_field}
<div class="panel-body">
@@ -54,7 +54,7 @@
<p>{intl l="These infos are available here : " d='recaptcha.bo.default'}<a href="http://www.google.com/recaptcha/admin">http://www.google.com/recaptcha/admin</a></p>
</div>
<div class="col-md-12">
<input class="btn btn-success form-control" type="submit">
<input type="submit" class="btn btn-success form-control">
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<script codesrc="https://www.google.com/recaptcha/api.js?hl={lang attr=""}" async defer></script>
<script src="https://www.google.com/recaptcha/api.js?hl={lang attr="code"}" async defer></script>
<script>
window.onload = function() {
var captchaDiv = document.getElementById("recaptcha-invisible");