From c224b93033f78a9618e0dd9eaaf5874f97608d54 Mon Sep 17 00:00:00 2001 From: Gregwar Date: Mon, 21 Jan 2013 14:04:53 +0100 Subject: [PATCH] Adding the "distortion" option --- DependencyInjection/Configuration.php | 1 + Generator/CaptchaGenerator.php | 2 ++ README.md | 1 + 3 files changed, 4 insertions(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 0b438cb..7e73c6a 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -38,6 +38,7 @@ class Configuration implements ConfigurationInterface ->scalarNode('bypass_code')->defaultValue(null)->end() ->scalarNode('whitelist_key')->defaultValue('captcha_whitelist_key')->end() ->scalarNode('humanity')->defaultValue(0)->end() + ->scalarNode('distortion')->defaultValue(true)->end() ->end() ; diff --git a/Generator/CaptchaGenerator.php b/Generator/CaptchaGenerator.php index 653d62b..2731d00 100644 --- a/Generator/CaptchaGenerator.php +++ b/Generator/CaptchaGenerator.php @@ -105,6 +105,8 @@ class CaptchaGenerator { $fingerprint = $this->getFingerprint($key, $options); + $this->builder->setDistortion($options['distortion']); + $content = $this->builder->build( $options['width'], $options['height'], diff --git a/README.md b/README.md index 880cbff..02cbaa0 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ You can define the following configuration options globally or on the CaptchaTyp * **whitelist_key**: the session key to use for keep the session keys that can be used for captcha storage, when using as_url (default=captcha_whitelist_key) * **reload**: adds a link to reload the code * **humanity**: number of extra forms that the user can submit after a correct validation, if set to a value different of 0, only 1 over (1+humanity) forms will contain a CAPTCHA (default=0, i.e each form will contain the CAPTCHA) +* **distortion**: enable or disable the distortion on the image (default=true, enabled) Example :