Topic: captcha helper
I created a simple captcha helper for Wolf cms. It makes use of the good old Securimage.
Having a captcha helper in Wolf cms makes implementing captcha's for individual plug-ins redundant and provides a consistent site-wide captcha.
Extract the complete contents of the zip file in "~/wolf/helpers/".
Usage example front-end (page or plug-in supplying HTML output):
<?php use_helper('Captcha'); $captcha = new Captcha(); echo '<form method="post" name="lalala">'; echo $captcha->getCaptcha(); echo '<input type="submit" />'; echo '</form>' ?>
Back-end (page, plug-in etc.):
<?php use_helper('Captcha'); $captcha = new Captcha(); echo $captcha->isValid() ? 'You go girl!' : 'Nah, try again'; ?>
It could use a method to check whether the captcha was used on a page in the first place but I didn't came up with a solid solution for it so far
Audio playback button is not implemented yet. I find Securimage's solution rather ugly
Additional documentation for each function can be found in the helper file
The helper is relatively large in size, despite its simplicity. This is because I have not touched securimage's source in any way
Is this helper a candidate for inclusion in Wolf cms? If yes, what does it take in terms of code style and should I strip securimage of it's audio capabilities and unused files to reduce its size?
Please take it for a spin, test it, and provide comments and suggestions.
I hope I don't have to tell you that you should not distribute it as is yet or apply it in a production environment. It's simply not (officially) stable yet.
Last edited by Forage (2012-02-21 17:38)