Adding settings to Captcha
Heine Thu, 2007/03/01 - 16:51
Update: MyCaptcha 1.0 has been released.
I've been adding some settings to the math captcha module I created earlier. An important setting is on which forms you want to have a captcha. While it is possible to hardcode the possible forms a captcha can appear on, I've opted for another approach.
I've created two helper modules called Form store and Form collect. If you enable Form collect, it will collect forms on your site while you visit them. You can view the collected forms on the Form store page. In the image below, you can see that I limited the collection to forms I thought useful for Captcha and that I've given most a more readable description. While I intend to include and add a description to all core forms, this has to be done manually for now.

Suppose you don't remember or know what form this cryptic form ID represents? Click on the tiny view link on the Captcha page or on the show link in the Form store and you'll see a "best guess" preview of the form.

For your own sanity it pays to quickly go over to the Form store and edit the description so you don't have to stare at the cryptic ID to long. As you will see, a quick edit on the Form store makes the Captcha settings page much friendlier.

If you want to test the modules, you can get them from the Subversion repository. You'll need both svn://heine.familiedeelstra.com/public/modules/mycap
and svn://heine.familiedeelstra.com/public/modules/form_store
.
f you've used the Drupal.org Captcha module on your site you will have to truncate the session table before using MyCaptcha. Issue the query: TRUNCATE sessions;
. This will log all user out. If you do not do this, you will get very odd math questions.
Obvious todos:
- Expiry
- Difficulty setting
- Clear the cache when captcha settings change
Warning: the module in the repository is still in development. Significant refactoring may occur. Also, some solutions are suboptimal or "on the way" to proper implementation. Revision 58 is a useable math captcha, later revisions have an image captcha implementation that is still undergoing development. To extract revision 58, you can use the following command: svn export -r58 svn://heine.familiedeelstra.com/public/modules/mycap
Update: some example image captcha's (various settings):
Comments
Form Store Support
Submitted by Fabiano Sant'Ana (not verified) on Mon, 2007/03/12 - 22:43Hi Heine,
I added support to your form store module in Captcha modules.
Thanks for the great work. ;)
fabiano
Only a bit of work left
Submitted by Heine on Mon, 2007/03/12 - 23:19Hi Fabiano,
You are welcome.
I'll add a bit of help soon, then add it to the Drupal.org CVS repository. I'm aiming for a dev release at first, then — if sufficient users report it is stable — a quick 5.x-1.0. For now, the attached archive has to do.
edit: Form store on Drupal.org.
Tested
Submitted by Dave Myburgh (i... (not verified) on Tue, 2007/03/13 - 15:33Heine & Fabiano, great work on this. I have installed the CVS Captcha and the form_store modules. Both seem to work perfectly on my 5.1 install.