Adds a "spam protection" field to SilverStripe userforms using Cloudflare's Turnstile service.

Overview

Turnstile for Silverstripe

Adds a "spam protection" field to SilverStripe userforms using Cloudflare's Turnstile service.

Maintainer Contact

Requirements

Installation

composer require webbuilders-group/silverstripe-turnstile

Configuration

There are multiple configuration options for the field, you must set the site_key and the secret_key which you can get from Cloudflare/. These configuration options must be added to your site's yaml config typically this is app/\_config/config.yml.

WebbuildersGroup\Turnstile\Forms\TurnstileField:
  site_key: '`TURNSTILE_SITE_KEY`' #Your site key (required)
  secret_key: '`TURNSTILE_SECRET_KEY`' #Your secret key (required)
  verify_ssl: true #Allows you to disable php-curl's SSL peer verification by setting this to false (optional, defaults to true)
  default_theme: "light" #Default theme color (optional, light, dark or auto, defaults to light)
  js_onload_callback: null #Onload callback to be called when the JS for Turnstile is loaded
  proxy_server: "`SS_OUTBOUND_PROXY_SERVER`" #Your proxy server address (optional)
  proxy_port: "`SS_OUTBOUND_PROXY_PORT`" #Your proxy server address port (optional)
  proxy_auth: "`SS_OUTBOUND_PROXY_AUTH`" #Your proxy server authentication information (optional)

Adding field labels

If you want to add a field label or help text to the Captcha field you can do so like this:

$form->enableSpamProtection()
    ->Fields()
      ->fieldByName('Captcha')
          ->setTitle('Spam protection')
          ->setDescription('Your description here');

Adding Custom Attributes

Turnstile has a few other options that this module does not out of the box provide hooks for setting, however you can set them your self using setAttribute for example:

$form->enableSpamProtection()
    ->Fields()
      ->fieldByName('Captcha')
          ->setAttribute('data-action', 'action')
          ->setAttribute('data-cdata', 'payload')
          ->setAttribute('data-callback', 'yourChallengeJSCallback')
          ->setAttribute('data-expired-callback', 'yourExpiredJSCallback')
          ->setAttribute('data-error-callback', 'youErrorJSCallback')
          ->setAttribute('data-tabindex', 0);
You might also like...
A measurement field for ProcessWire

Fieldtype Measurement This fieldtype allows a measurement unit to be stored with a corresponding measurement value ('magnitude'). The relevant details

A layout field that forces translations to have the same structure.
A layout field that forces translations to have the same structure.

Kirby translatedlayout plugin A layout field that forces translations to have anidentical structure to the one of the default language. This is an exp

A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.
A Symfony2 bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.

select2entity-bundle Introduction This is a Symfony bundle which enables the popular Select2 component to be used as a drop-in replacement for a stand

Magento 2 extension. Strekoza_GoogleCategory. Add Category Attribute (field) - "Google Category"

Magento 2 extension. Strekoza_GoogleCategory Magento 2 extension. Add Category Attribute (field) - "Google Category" This exstension will add Category

Nagios/Icinga plugin for checking SATEON field network device status

check_sateon Nagios/Icinga plugin for checking SATEON field network device status Max.Fischer [email protected] Tested on CentOS GNU/Linux 6.5 with Ici

Ranting field for the Filament forms
Ranting field for the Filament forms

Ranting field for the Filament forms

Multi-language field export/import tool for ProcessWire

Language field export/import for ProcessWire Typically the way you translate page field values in ProcessWire is to edit a page, view the text in one

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

SilverStripe Garbage Collection Module

SilverStripe Module for defining and processing Garbage Collection on SilverStripe Applications.

Owner
Webbuilders Group
We Build Web Presence For Happy Clients
Webbuilders Group
Silverstripe-searchable - Adds to the default Silverstripe search by adding a custom results controller and allowing properly adding custom data objects and custom fields for searching

SilverStripe Searchable Module UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.* Adds more c

ilateral 13 Apr 14, 2022
Markdownfield - Markdown field for SilverStripe

MarkdownField This module introduces a new DB field type Markdown & Markdown Editor. It uses github style Markdown style. And uses the simple markdown

SilverStripers 10 Jul 10, 2022
This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every translatable field.

Autotranslate This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every

null 4 Jan 3, 2022
Silverstripe-masquerade - SilverStripe module to allow users to "masquerade" as other users

SilverStripe Masquerade Module About This module is designed to allow an Administrator to "login" as another "Member" without changing their password

Daniel Hensby 14 Apr 14, 2022
Silverstripe-debugbar/ - SilverStripe DebugBar module

SilverStripe DebugBar module Requirements SilverStripe ^4.0 maximebf/php-debugbar jdorn/sql-formatter Installation You can install the debug bar with

Thomas Portelange 52 Dec 21, 2022
A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in SilverStripe

A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in Silver

null 4 Apr 20, 2022
Cloudflare Turnstile anti-spam plugin for Joomla!

Cloudflare Turnstile anti-spam plugin for Joomla! Turnstile is Cloudflare's smart CAPTCHA alternative. It can be embedded into any website without sen

null 2 Nov 10, 2022
Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.

Dubbox now means Dubbo eXtensions. If you know java, javax and dubbo, you know what dubbox is :) Dubbox adds features like RESTful remoting, Kyro/FST

当当 4.9k Dec 27, 2022
Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance

Silverstripe Sendy Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance. Introduction

Syntro Opensource 4 Apr 20, 2022
Bundle providing Honeypot field for the Form Builder in Ibexa DXP Experience/Commerce (3.X)

IbexaHoneypot Bundle providing Honeypot field for the Form Builder in Ibexa DXP Experience/Commerce (3.X) What is Honey pot? A honey pot trap involves

null 1 Oct 14, 2021