Captcha Extended enhances original captcha implementation supplied with the framework by adding more visual masking techniques and implementing logical phrases that are harder to break by spammers.



This extension will run right out of the box on Yii 1.1.7+ However, with minor tweaks you can run it on any previous version (uses $classmap and enableClientValidation introduced in 1.1.7, you can replace class registration e.g. with importing whole directory, which however is less performance wise).
1) Unzip CaptchaExtended.zip files into ../protected/extensions/captchaExtended/.
2) Register class paths to CaptchaExtendedAction and CaptchaExtendedValidator, e.g. in components/controller.php:
public function init(){ // register class paths for extension captcha extended Yii::$classMap = array_merge( Yii::$classMap, array( 'CaptchaExtendedAction' => Yii::getPathOfAlias('ext.captchaExtended').DIRECTORY_SEPARATOR.'CaptchaExtendedAction.php', 'CaptchaExtendedValidator' => Yii::getPathOfAlias('ext.captchaExtended').DIRECTORY_SEPARATOR.'CaptchaExtendedValidator.php' )); }
3) Define action in controller, e.g. SiteController:
public function actions(){ return array( 'captcha'=>array( 'class'=>'CaptchaExtendedAction', ), ); }
4) Define client validation in model::rules():
public function rules(){ return array( array('verifyCode', 'CaptchaExtendedValidator', 'allowEmpty'=>!CCaptcha::checkRequirements()), ); }
5) If needed, collect localized strings via CLI command "yiic message messages/config.php" and translate captcha related strings.
6) If needed, you can tune captcha modes and visibility options:
7) Test & enjoy!
Total 14 comments
I've got Captcha extended working on my forms on my site. However, I can for the life of me get it to work with Yii-User module. The model won't validate!
Has anyone done this succesfully?
OK, switched to BSD license.
Yii is licensed BSD - extensions should be the same!
it is good,but if BSD ,that is cool. good job. thank you
For those of you who like to use ajax validation in your forms, you can add this at the top of this function:
CaptchaExtendedAction.validate($input,$caseSensitive)
Thank you, looks good.
@Ivashkin: You call it just like normal CCaptcha widget from any view/layout file:
This will look for controller action "captcha" which is defined in array of actions. See step 3 above.
Cheers Lubos
how to call in the source, show in example sorry for my bad english
1> GPL --
Open source any application which contains code licensed under GPL. It is a must.
2> LGPL --
You must open source the modifications done on the original library under GPL licence. But, author may add a clause to loosen restrictions on inclusion of his code for other closed source applications.
3> BSD --
Modify, distribute, hack, make it closed source, use it for proprietary application until you give original author his credits for his work.
Correct me if i'm wrong or not clear :)
Hi, licence changed to LGPL. Cheers. Lubos
I'm not an expert in opensource licensing, but I will never use GPL licensed software in my projects.
The problem is, that you (maybe??) can be enforced to 'opensource' all your (own) code if you integrate GPL code and deploy your project.
You can find a lot of discussions about the viral effect of GPL. I don't know if it's really like a virus, but I avoid to integrate GPL code.
If you change the license to LGPL or other, I would use your nice extension :-)
Hi,
actually I am always confused about licensing. There so many variants, but I do not know detailed differences. But I saw, that BSD license (pre-set, also Yii is distributed under BSD) requires to retain authoring info. I do not want that. Do whatever you want, put your own authoring credentials, modify, copy, distribute, whatever. So I opted for GPL version 3 since I guessed this is more like free license and the version 3 should be most modern and really cool, since it has been updated already 3 times:-)))
But seriously, it would be good to make up summary about the differences betweeen all open source licenses...
If there is better option than GPL v3 I still can change it.
Lubos
Hi,
It looks very good. Thank you very much.
But why GPL license?
looks cool; like your extension , it looks more beautiful then the CCapthcha. actually i 'v thought to write my own one , yours look pretty enough .
Leave a comment
Please login to leave your comment.