2017 © Pedro Peláez
 

silverstripe-module recaptcha

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

image

silverstripe/recaptcha

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  • Friday, January 12, 2018
  • by chillu
  • Repository
  • 4 Watchers
  • 24 Stars
  • 42,204 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 37 Forks
  • 8 Open issues
  • 11 Versions
  • 6 % Grown

The README.md

reCAPTCHA FormField Module

Build Status, (*1)

This module is no longer supported. Please use UndefinedOffset/silverstripe-nocaptcha instead, (*2)

Introduction

Provides a FormField which allows form to validate for non-bot submissions using Google's reCAPTCHA v2 service., (*3)

In order to use Google's new Invisible reCAPTCHA service, please use the undefinedoffset/silverstripe-nocaptcha module. This module is not intended to be used with reCAPTCHA v3 (see rationale), (*4)

Requirements

  • SilverStripe Framework 4.0 or newer
  • curl PHP module
  • Requires spamprotection module

Installation

  • Copy the recaptcha directory into your main SilverStripe webroot
  • Run ?flush=1

This should go in your mysite/_config/recaptcha.yml. You can get an free API key at https://www.google.com/recaptcha, (*5)

SilverStripe\Recaptcha\RecaptchaField:
  public_api_key: "your-site-key"
  private_api_key: "your-secret-key"

If using on a site requiring a proxy server for outgoing traffic then you can set these additional options in your mysite/_config/recaptcha.yml by adding., (*6)

  proxy_server: "proxy_address"
  proxy_auth: "username:password"

To use the noscript fallback method, add the key noscript_enabled: true to your yml., (*7)

To change the language, add it to an array of options to your yml, (*8)

  options: 
    hl: NL
    theme: dark
    type: audio
    size: compact

See https://developers.google.com/recaptcha/docs/display#render_param for all available parameters, (*9)

Usage

As a Standalone Field

If you want to use reCAPTCHA field by itself, you can simply just include it as a field in your form., (*10)

$recaptchaField = new RecaptchaField('MyCaptcha');
$recaptchaField->options = array('theme' => 'light'); // optional

See reCAPTCHA docs for more configuration options., (*11)

Integration with spamprotection module

This requires the spamprotection module to be installed, see its documentation for details. You can use this field to protect any built informs on your website, including user comments in the [[:modules:blog]] module., (*12)

Configuration example in mysite/_config/spamprotection.yml, (*13)

---
name: spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: SilverStripe\Recaptcha\RecaptchaProtector

Then once you have setup this config you will need to include the spam protector field as per the instructions on the spamprotection page., (*14)

Known issues:

Problems with page doctype XHTML

reCAPTCHA current does not work if the page doctype is XHTML. The API returns Javascript which uses "document.write", which is not supported in XHTML. A work-around is to always use the no-script version of the module (modify the relevant lines in RecaptchaField.php), or to switch your webpage's doctype to HTML 4. See: http://www.w3schools.com/tags/tag_DOCTYPE.asp, (*15)

The Versions

12/01 2018

2.0.x-dev

2.0.9999999.9999999-dev

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

12/01 2018

2.0.3

2.0.3.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

12/01 2018

dev-master

9999999-dev

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

The Development Requires

silverstripe spamprotection

12/10 2016

2.0.1

2.0.1.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

12/10 2016

2.0.2

2.0.2.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

04/10 2016

2.0.0

2.0.0.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

22/02 2016

1.2.1

1.2.1.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

11/02 2014

1.1.x-dev

1.1.9999999.9999999-dev

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

19/12 2013

1.1.0

1.1.0.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

19/12 2013

1.2.0

1.2.0.0

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection

04/04 2013

1.0.x-dev

1.0.9999999.9999999-dev

Provides a form field which allows form to validate for non-bot submissions by giving them a challenge to decrypt an image.

  Sources   Download

The Requires

 

silverstripe spamprotection