2017 © Pedro Peláez
 

cakephp-plugin cakephp-invisible-recaptcha

cakephp-invisible-recaptcha plugin for CakePHP

image

mosaxiv/cakephp-invisible-recaptcha

cakephp-invisible-recaptcha plugin for CakePHP

  • Thursday, January 25, 2018
  • by mosaxiv
  • Repository
  • 2 Watchers
  • 5 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 28 % Grown

The README.md

cakephp-invisible-recaptcha plugin for CakePHP

MIT License Build Status, (*1)

Requirements

  • CakePHP 3.4.0+

Installation

composer require mosaxiv/cakephp-invisible-recaptcha

obtain a invisible reCAPTCHA API key., (*2)

SetUp

Configure

With the following test keys, you will always get No CAPTCHA and all verification requests will pass.
Please do not use these keys for your production traffic., (*3)

Configure::write('recaptcha', [
    'sitekey' => '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
    'secretkey' => '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe',
]);

loadComponent

$this->loadComponent('InvisibleReCaptcha.InvisibleReCaptcha',
    [
        // options
    ]);

Some of the options available:, (*4)

Option Description Default Value
secretkey Override secret API key null
sitekey Override site API key null
hl Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. (See language codes) null
badge Optional. Reposition the reCAPTCHA badge.inline allows you to control the CSS. bottomright bottomright
bottomleft
inline
type Optional. The type of CAPTCHA to serve. image audio
image
timeout The number of seconds to wait for reCAPTCHA servers before give up. 3 integer
noscript Include <noscript> content true boolean

docs https://developers.google.com/recaptcha/docs/invisible#config, (*5)

Used

Display recaptcha in your view

<?php
echo $this->Form->create();
echo $this->Form->control('email');
echo $this->Form->submit();
echo $this->InvisibleReCaptcha->render();
echo $this->Form->end();
?>

Verify in your controller

if ($this->InvisibleReCaptcha->verify()) {
    //do something
}

use ServerRequest::clientIp to get the IP address.
See https://book.cakephp.org/3.0/en/controllers/request-response.html#trusting-proxy-headers, (*6)

The Versions

25/01 2018

dev-master

9999999-dev

cakephp-invisible-recaptcha plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

31/12 2017

v1.0.0

1.0.0.0

cakephp-invisible-recaptcha plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires