evoweb / recaptcha
对人类友好,对机器人严格
13.0.2
2024-08-30 16:11 UTC
Requires
- psr/http-message: ^1.1 || ^2.0
- typo3/cms-core: ^12.4 || 12.4.x-dev || ^13.0 || 13.3.x-dev || dev-main
- typo3/cms-extbase: ^12.4 || 12.4.x-dev || ^13.0 || 13.3.x-dev || dev-main
- typo3/cms-fluid: ^12.4 || 12.4.x-dev || ^13.0 || 13.3.x-dev || dev-main
- typo3/cms-frontend: ^12.4 || 12.4.x-dev || ^13.0 || 13.3.x-dev || dev-main
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.57.1
Suggests
- dev-develop
- 13.0.2
- 13.0.1
- 13.0.0
- 12.x-dev
- 12.0.2
- 12.0.1
- 12.0.0
- 11.x-dev
- 11.0.4
- 11.0.3
- 11.0.2
- 11.0.1
- 11.0.0
- 10.x-dev
- 10.0.3
- 10.0.2
- 10.0.1
- 10.0.0
- 9.1.3
- 9.1.2
- 9.1.1
- 9.1.0
- 9.0.1
- 9.0.0
- 8.x-dev
- 8.5.0
- 8.4.0
- 8.3.0
- 8.2.8
- 8.2.7
- 8.2.6
- 8.2.5
- 8.2.4
- 8.2.3
- 8.2.2
- 8.2.1
- 8.2.0
- 8.1.0
- 7.x-dev
- 7.4.0
- 7.2.3
- 7.2.2
- 7.2.1
- 7.2.0
- 6.x-dev
- 1.0.0
- dev-main
This package is auto-updated.
Last update: 2024-09-12 15:54:25 UTC
README
TYPO3 扩展,用于利用谷歌的 nocaptcha 功能。
现在支持谷歌的无痕 reCAPTCHA。
安装
通过 Composer
推荐使用 Composer 安装 TYPO3 控制台
composer require evoweb/recaptcha
通过 TYPO3 扩展存储库
使用扩展管理模块或直接从 TER 下载并安装扩展。
在 tx_form typoscript 表单中集成无痕 reCAPTCHA
要使用此 captcha,请将此扩展的静态包含添加到您的模板中。
之后,在表单的 typoscript 中添加。
lib.contactForm = FORM
lib.contactForm {
70 < lib.invisibleRecaptchaIntegration.10
rules {
7 < lib.invisibleRecaptchaIntegration.rules.1
}
}
在自定义表单中集成无痕 reCAPTCHA
要使用此 captcha,请将此扩展的静态包含添加到您的模板中。
之后,通过将提交按钮替换为类似以下内容来修改您的表单输出
<button
data-sitekey="6LfmFxQUAAAAAGiMRvzLHGYQ8KiQiqgBuY5NswDz"
data-callback="onContactformCaptchaSubmit"
class="g-recaptcha"
type="button" name="tx_form_form[tx_form][id-11]"
value="absenden">
absenden
</button>
之后,您的前端就准备好了,但还需要在您的 php 代码中调用验证。
$validCaptcha = false;
$captchaService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Evoweb\Recaptcha\Services\CaptchaService::class);
$captchaServiceValidation = $captchaService->validateReCaptcha();
if (isset($captchaServiceValidation['verified'])) {
if ($captchaServiceValidation['verified'] === true) {
$validCaptcha = true;
}
}