2017 © Pedro Peláez
 

typo3-flow-package recaptcha

Integration of google's reCAPTCHA

image

typo3/recaptcha

Integration of google's reCAPTCHA

  • Wednesday, April 2, 2014
  • by visay
  • Repository
  • 5 Watchers
  • 0 Stars
  • 169 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Recaptcha -- TYPO3 Flow v1.0.0

-- Integration of google's recaptcha --, (*1)

(c) Christopher Doerge, Incloud GmbH, (*2)

The module is finally tested., (*3)

Installation

Include the package to the require section in your composer.json file, (*4)

    "require": {
        ................................
        "typo3/recaptcha": "dev-master",
        ................................
    },

After this go to http://www.google.com/recaptcha and create some keys for your website, (*5)

Add them in Settings.yaml:, (*6)

TYPO3:
  Recaptcha:
    security:
      publicKey: "yourgeneratedpublickey"
      privateKey: "yourgeneratedprivatekey"

Usage of the view helper

Just add namespace for the view helper and use it in your template without any parameter as shown in the example below:, (*7)

{namespace tr=TYPO3\Recaptcha\ViewHelpers}

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Index view of Recaptcha Demo</title> 
    <f:base />
  </head>
  <body>
    <h1>Recaptcha Demo</h1>
    <f:flashMessages class="flashmessages" />
    <f:form action="validate" controller="Standard" method="post" name="validationform">
      <tr:form.captcha />
      <f:form.submit value="Validate" />
    </f:form>
  </body>
</html>

Usage of the validator

Now you can use the validator in your validate action.
Parameters are the recaptcha_challenge_field and the recaptcha_response_field delivered by the form., (*8)

class StandardController extends \TYPO3\Flow\MVC\Controller\ActionController {

  /**
   * Your validate action with captcha field
   *
   * @Flow\Validate("$captchaResponse", type="TYPO3\Recaptcha\Validation\Validator\CaptchaValidator")
   * @return void
   */
  public function validateAction($captchaResponse) {
    // validation is automatically done and if we reach this code, the captcha was filled successfully
    $this->redirect("index");
  }

}

Remember functionality

You can can let the recaptcha module add the successfuly solution of the captcha to the session by setting the third parameter of validate function to true.
Your Application will now remember for specified period of time you can also set in the settings.yaml. The default time for this period is 900 seconds., (*9)

TYPO3:
  Recaptcha:
    security:
      publicKey: "yourgeneratedpublickey"
      privateKey: "yourgeneratedprivatekey"
    memory:
      validTime: 900

You can manually unremember by using the invalidate function of the recaptcha model., (*10)

I18N

English is the only language that is supported at the moment. It is planned to provide internationalization functionality when FLOW3 1.1 finally appears., (*11)

License

All the code is licensed under the GPL license., (*12)

The Versions

02/04 2014

dev-master

9999999-dev

Integration of google's reCAPTCHA

  Sources   Download

The Requires

 

19/03 2014

dev-refactoring

dev-refactoring

Integration of google's reCAPTCHA

  Sources   Download

The Requires