25 Commits

Author SHA1 Message Date
8199d20092 Merge branch 'master' of github.com:Gregwar/CaptchaBundle 2014-02-14 11:29:31 +01:00
8770c50ff0 Updating gregwar/captcha to v1.0.10 2014-02-14 11:29:03 +01:00
721a2b1f3d Merge pull request #78 from verschoof/translation/english
Added English translation
2014-02-14 10:36:48 +01:00
e2f1966bfb Merge pull request #77 from verschoof/translation/dutch
Added Dutch translation
2014-02-14 10:35:57 +01:00
2f508ddd07 Added English translation 2014-02-14 10:26:58 +01:00
2e803e1471 Added Dutch translation 2014-02-14 10:24:32 +01:00
800643d72c Merge pull request #74 from regisnew/master
[ADD]
2013-11-25 02:48:00 -08:00
c09b7245b1 [ADD]
- translate validators to Brazilian portuguese.
2013-11-25 08:44:26 -02:00
c3c8904862 Merge pull request #73 from regisnew/master
[ADD]
2013-11-23 02:20:39 -08:00
9d4f95e39b [ADD]
- Brazilian Portuguese translate
2013-11-22 19:52:20 -02:00
107dbe33e4 Adding disabled global option (fixes #72) 2013-11-19 10:51:58 +01:00
6b4e7db721 Merge branch 'master' of github.com:Gregwar/CaptchaBundle 2013-09-21 13:45:18 +02:00
aef6a785ca Merge pull request #69 from oktron/master
Add german translation
2013-09-06 08:01:56 -07:00
fc72ab4f6c Add german translation 2013-09-06 16:59:19 +02:00
e3727a975d Merge branch 'master' of github.com:Gregwar/CaptchaBundle 2013-08-14 09:45:48 +02:00
9d741e0ac6 v1.0.8 2013-08-14 09:45:35 +02:00
0ab26cac81 Merge pull request #67 from sergeylunev/master
Add translation to russian.
2013-08-08 05:38:09 -07:00
ddab3ef005 Add translation to russian. 2013-08-08 16:31:34 +04:00
0b08b38cb0 Enhancing documentation about font option (fixes #66) 2013-08-07 15:46:23 +02:00
3f64e064d3 Mergin & fixing text_color & background_color (fixes #57) 2013-08-07 11:18:16 +02:00
9578caab10 Merge remote-tracking branch 'color/master' 2013-08-07 11:08:16 +02:00
7f30646c68 Moving the "reload without as_url" exception to catch more cases (see 2013-08-07 10:57:56 +02:00
daec205870 Adjust text_color execption line indention. 2013-04-29 10:17:04 +08:00
1881d292b8 Fixed text_color and background_color validation exception. 2013-04-29 10:13:58 +08:00
181b0cd0d0 Added text_color option. 2013-04-29 08:50:17 +08:00
16 changed files with 32 additions and 9 deletions

View File

@ -42,7 +42,9 @@ class Configuration implements ConfigurationInterface
->scalarNode('max_front_lines')->defaultValue(null)->end()
->scalarNode('max_behind_lines')->defaultValue(null)->end()
->scalarNode('interpolation')->defaultValue(true)->end()
->arrayNode('background_color')->prototype('scalar')->end()
->arrayNode('text_color')->prototype('scalar')->end()->end()
->arrayNode('background_color')->prototype('scalar')->end()->end()
->scalarNode('disabled')->defaultValue(false)->end()
->end()
;

View File

@ -33,10 +33,6 @@ class GregwarCaptchaExtension extends Extension
$container->setParameter('gregwar_captcha.config.expiration', $config['expiration']);
$container->setParameter('gregwar_captcha.config.whitelist_key', $config['whitelist_key']);
if ($config['reload'] && !$config['as_url']) {
throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information');
}
$resources = $container->getParameter('twig.form.resources');
$container->setParameter('twig.form.resources', array_merge(array('GregwarCaptchaBundle::captcha.html.twig'), $resources));
}

View File

@ -98,8 +98,17 @@ class CaptchaGenerator
$this->builder->setMaxFrontLines($options['max_front_lines']);
$this->builder->setMaxBehindLines($options['max_behind_lines']);
if ($options['background_color'] != array()) {
if (count($options['background_color'])!=3) {
if (isset($options['text_color']) && $options['text_color']) {
if (count($options['text_color']) !== 3) {
throw new \RuntimeException('text_color should be an array of r, g and b');
}
$color = $options['text_color'];
$this->builder->setTextColor($color[0], $color[1], $color[2]);
}
if (isset($options['background_color']) && $options['background_color']) {
if (count($options['background_color']) !== 3) {
throw new \RuntimeException('background_color should be an array of r, g and b');
}

View File

@ -123,10 +123,12 @@ You can define the following configuration options globally or on the CaptchaTyp
* **width**: the width of the captcha image (default=120)
* **height**: the height of the captcha image (default=40)
* **disabled**: disable globally the CAPTCHAs (can be useful in dev environment), it will
still appear but won't be editable and won't be checked
* **length**: the length of the captcha (number of chars, default 5)
* **quality**: jpeg quality of captchas (default=15)
* **charset**: the charset used for code generation (default=abcdefhjkmnprstuvwxyz23456789)
* **font**: the font to use (default=Generator/Font/captcha.ttf)
* **font**: the font to use (default is random among some pre-provided fonts), this should be an absolute path
* **keep_value**: the value will be the same until the form is posted, even if the page is refreshed (default=true)
* **as_file**: if set to true an image file will be created instead of embedding to please IE6/7 (default=false)
* **as_url**: if set to true, a URL will be used in the image tag and will handle captcha generation. This can be used in a multiple-server environment and support IE6/7 (default=false)

View File

@ -0,0 +1 @@
Renew: Erneuern

View File

@ -0,0 +1 @@
Renew: Renew

View File

@ -0,0 +1 @@
Renew: Vernieuwen

View File

@ -0,0 +1 @@
Renew: Regerar

View File

@ -0,0 +1 @@
Renew: Обновить

View File

@ -0,0 +1 @@
Bad code value: Code stimmt nicht überein

View File

@ -0,0 +1 @@
Bad code value: Code does not match

View File

@ -0,0 +1 @@
Bad code value: Code komt niet overeen

View File

@ -0,0 +1 @@
Bad code value: Código de verificação inválido

View File

@ -0,0 +1 @@
Bad code value: Неправильный код

View File

@ -90,6 +90,10 @@ class CaptchaType extends AbstractType
{
$isHuman = false;
if ($options['reload'] && !$options['as_url']) {
throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information');
}
if ($options['humanity'] > 0) {
$humanityKey = $this->key.'_humanity';
if ($this->session->get($humanityKey, 0) > 0) {

View File

@ -18,7 +18,7 @@
],
"require": {
"php": ">=5.3.0",
"gregwar/captcha": "v1.0.7"
"gregwar/captcha": "v1.0.10"
},
"autoload": {
"psr-0": {