Skip to content

A spam protector and form field for Silverstripe using hCaptcha.

License

Notifications You must be signed in to change notification settings

3Dgoo/silverstripe-hcaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a9ef6c3 · Jan 10, 2024

History

23 Commits
May 4, 2020
May 18, 2020
May 4, 2020
Jan 10, 2024
Nov 18, 2020
May 19, 2020
May 4, 2020
May 18, 2020
May 4, 2020
May 4, 2020
Jun 30, 2022
May 3, 2020
Jan 10, 2024
May 4, 2020
Jul 30, 2023
May 4, 2020
May 4, 2020
May 4, 2020

Repository files navigation

Silverstripe hCaptcha spam protection

Build Status codecov.io Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

A spam protection field for Silverstripe using the hCaptcha service.

hCaptcha screenshot

Requirements

Installation (with composer)

$ composer require 3dgoo/silverstripe-hcaptcha

Configuration

After installing the module via composer we must set the spam protector to HCaptchaProtector through a config yml file.

Create a app/_config/spamprotection.yml file and add the following details:

---
name: app-spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: X3dgoo\HCaptcha\Forms\HCaptchaProtector

X3dgoo\HCaptcha\Forms\HCaptchaField:
  site_key: "YOUR_SITE_KEY"
  secret_key: "YOUR_SECRET_KEY"

We generate our site key and secret key at https://www.hcaptcha.com/

The default language of the captcha will be set to the site language. This can be changed by setting the language_code variable to any of the available hCaptacha languages. If not set this will default to the current site locale:

X3dgoo\HCaptcha\Forms\HCaptchaField:
  language_code: "de"