Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
980afdc10a | |||
791128c0fd | |||
639430383f | |||
8e98c5c0ab | |||
539884cd5d | |||
8ce4adb1b1 | |||
b787a8002e | |||
045ba7e67e | |||
18c85d3a4f | |||
1f6c80c326 |
@ -33,7 +33,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->scalarNode('web_path')->defaultValue('%kernel.root_dir%/../web')->end()
|
->scalarNode('web_path')->defaultValue('%kernel.root_dir%/../web')->end()
|
||||||
->scalarNode('gc_freq')->defaultValue(100)->end()
|
->scalarNode('gc_freq')->defaultValue(100)->end()
|
||||||
->scalarNode('expiration')->defaultValue(60)->end()
|
->scalarNode('expiration')->defaultValue(60)->end()
|
||||||
->scalarNode('quality')->defaultValue(30)->end()
|
->scalarNode('quality')->defaultValue(50)->end()
|
||||||
->scalarNode('invalid_message')->defaultValue('Bad code value')->end()
|
->scalarNode('invalid_message')->defaultValue('Bad code value')->end()
|
||||||
->scalarNode('bypass_code')->defaultValue(null)->end()
|
->scalarNode('bypass_code')->defaultValue(null)->end()
|
||||||
->scalarNode('whitelist_key')->defaultValue('captcha_whitelist_key')->end()
|
->scalarNode('whitelist_key')->defaultValue('captcha_whitelist_key')->end()
|
||||||
|
@ -34,6 +34,6 @@ class GregwarCaptchaExtension extends Extension
|
|||||||
$container->setParameter('gregwar_captcha.config.whitelist_key', $config['whitelist_key']);
|
$container->setParameter('gregwar_captcha.config.whitelist_key', $config['whitelist_key']);
|
||||||
|
|
||||||
$resources = $container->getParameter('twig.form.resources');
|
$resources = $container->getParameter('twig.form.resources');
|
||||||
$container->setParameter('twig.form.resources', array_merge(array('GregwarCaptchaBundle::captcha.html.twig'), $resources));
|
$container->setParameter('twig.form.resources', array_merge(array('@GregwarCaptcha/captcha.html.twig'), $resources));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
Gregwar's CaptchaBundle
|
Gregwar's CaptchaBundle
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YUXRLWHQSWS6L)
|
||||||
|
|
||||||
The `GregwarCaptchaBundle` adds support for a captcha form type for the
|
The `GregwarCaptchaBundle` adds support for a captcha form type for the
|
||||||
Symfony form component.
|
Symfony form component.
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@ parameters:
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
captcha.type:
|
captcha.type:
|
||||||
class: '%gregwar_captcha.captcha_type.class%'
|
class: '%gregwar_captcha.captcha_type.class%'
|
||||||
|
public: true
|
||||||
arguments:
|
arguments:
|
||||||
- '@session'
|
- '@session'
|
||||||
- '@gregwar_captcha.generator'
|
- '@gregwar_captcha.generator'
|
||||||
@ -18,6 +19,7 @@ services:
|
|||||||
|
|
||||||
gregwar_captcha.generator:
|
gregwar_captcha.generator:
|
||||||
class: '%gregwar_captcha.captcha_generator.class%'
|
class: '%gregwar_captcha.captcha_generator.class%'
|
||||||
|
public: true
|
||||||
arguments:
|
arguments:
|
||||||
- '@router'
|
- '@router'
|
||||||
- '@gregwar_captcha.captcha_builder'
|
- '@gregwar_captcha.captcha_builder'
|
||||||
@ -26,6 +28,7 @@ services:
|
|||||||
|
|
||||||
gregwar_captcha.image_file_handler:
|
gregwar_captcha.image_file_handler:
|
||||||
class: '%gregwar_captcha.image_file_handler.class%'
|
class: '%gregwar_captcha.image_file_handler.class%'
|
||||||
|
public: true
|
||||||
arguments:
|
arguments:
|
||||||
- '%gregwar_captcha.config.image_folder%'
|
- '%gregwar_captcha.config.image_folder%'
|
||||||
- '%gregwar_captcha.config.web_path%'
|
- '%gregwar_captcha.config.web_path%'
|
||||||
@ -34,6 +37,8 @@ services:
|
|||||||
|
|
||||||
gregwar_captcha.captcha_builder:
|
gregwar_captcha.captcha_builder:
|
||||||
class: '%gregwar_captcha.captcha_builder.class%'
|
class: '%gregwar_captcha.captcha_builder.class%'
|
||||||
|
public: true
|
||||||
|
|
||||||
gregwar_captcha.phrase_builder:
|
gregwar_captcha.phrase_builder:
|
||||||
class: '%gregwar_captcha.phrase_builder.class%'
|
class: '%gregwar_captcha.phrase_builder.class%'
|
||||||
|
public: true
|
||||||
|
@ -113,7 +113,8 @@ class CaptchaType extends AbstractType
|
|||||||
));
|
));
|
||||||
|
|
||||||
$persistOptions = array();
|
$persistOptions = array();
|
||||||
foreach (array('phrase', 'width', 'height', 'distortion', 'length', 'quality', 'background_color', 'text_color') as $key) {
|
foreach (array('phrase', 'width', 'height', 'distortion', 'length',
|
||||||
|
'quality', 'background_color', 'background_images', 'text_color') as $key) {
|
||||||
$persistOptions[$key] = $options[$key];
|
$persistOptions[$key] = $options[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.9",
|
"php": ">=5.3.9",
|
||||||
"gregwar/captcha": "~1.1",
|
"gregwar/captcha": "~1.1",
|
||||||
"symfony/framework-bundle": "~2.1|~3.0",
|
"symfony/framework-bundle": "~2.8|~3.0|~4.0",
|
||||||
"symfony/form": "~2.1|~3.0"
|
"symfony/form": "~2.8|~3.0|~4.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
Reference in New Issue
Block a user