GithubHelp home page GithubHelp logo

camfindlay / silverstripe-nocaptcha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from undefinedoffset/silverstripe-nocaptcha

0.0 0.0 0.0 121 KB

A spam protector and form field using the new Google's reCAPTCHA 2 aka No Captcha.

License: BSD 3-Clause "New" or "Revised" License

PHP 89.91% JavaScript 6.98% Scheme 3.10%

silverstripe-nocaptcha's Introduction

Nocaptcha

A spam protector and form field using the new Google's reCAPTCHA 2 aka No Captcha.

Requirements

Installation

  • Download the module from here
  • Extract the downloaded archive into your site root so that the destination folder is called nocaptcha, opening the extracted folder should contain _config.php in the root along with other files/folders
  • Run dev/build?flush=all to regenerate the manifest

If you prefer you may also install using composer:

composer require undefinedoffset/silverstripe-nocaptcha

After installing the module via composer or manual install you must set the spam protector to NocaptchaProtector, this needs to be set in your site's config file normally this is mysite/_config/config.yml.

FormSpamProtectionExtension:
    default_spam_protector: NocaptchaProtector

Configuration

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

NocaptchaField:
    site_key: "YOUR_SITE_KEY" #Your site key (required)
    secret_key: "YOUR_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 or dark, defaults to light)
    default_type: "image" #Default captcha type (optional, image or audio, defaults to image)
    proxy_server: "" #Your proxy server address (optional)
    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("Please tick the box to prove you're a human and help us stop spam.");

Reporting an issue

When you're reporting an issue please ensure you specify what version of SilverStripe you are using i.e. 3.1.3, 3.2beta, master etc. Also be sure to include any JavaScript or PHP errors you receive, for PHP errors please ensure you include the full stack trace. Also please include how you produced the issue. You may also be asked to provide some of the classes to aid in re-producing the issue. Stick with the issue, remember that you seen the issue not the maintainer of the module so it may take allot of questions to arrive at a fix or answer.

silverstripe-nocaptcha's People

Contributors

undefinedoffset avatar christopherdarling avatar camfindlay avatar jonom avatar thezenmonkey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.