Heine

  • home
  • drupal
  • drupal core commits
  • about
Home › Drupal

Adding settings to Captcha

Heine — Thu, 01/03/2007 - 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):




Average: 1 (2 votes)
  • Captcha
  • Drupal

Form Store Support

Fabiano Sant'Ana (not verified) — Mon, 12/03/2007 - 22:43

Hi Heine,
I added support to your form store module in Captcha modules.
Thanks for the great work. ;)

fabiano

  • reply

Only a bit of work left

Heine — Mon, 12/03/2007 - 23:19

Hi 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.

  • reply

Tested

Dave Myburgh (incrn8) (not verified) — Tue, 13/03/2007 - 15:33

Heine & 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.

  • reply

Post new comment

I reserve the right to edit any comment submitted to the site. If your comment contains flaming, advertisements, or simply too many spelling errors (leet speak), it may never appear.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <as>, <as3>, <csharp>, <diff>, <drupal5>, <drupal6>, <html>, <js>, <mysql>, <php>, <phpbrief>, <python>, <sql>, <plain>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

Recent posts

  • Planet Drupal past and current
  • Help! - Cannot access a global variable.
  • Why is my module's update hook not listed on update.php's selection form?
  • How do I add a class to a link generated with l()
  • ZeroDayScan - Full path disclosure bug in Drupal 6.16 (0day)
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF Drupal embed Input Format modx OpenID Performance Planet Drupal rants Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.