Captcha interface

kps - April 16, 2005 - 22:25
Project:CAPTCHA
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:arnabdotorg
Status:closed
Description

The attached patch provides the Captcha module with a two-part interface to other modules.

First, it defines two functions that other modules can call to present a captcha challenge. (For example, I have written an input filter module that encodes email addresses to protect them from spam harvesters; using this interface, it can present a captcha challenge before revealing the email address.) This interface consists of two functions: captcha_form(), which generates form items for the challenge, and captcha_test(), which tests the user's response.

Second, it defines a hook interface so that other modules can implement different captcha tests. (At present, the administrator selects which available test to use; in the future, this could be extended to, for example, permit visually impaired users to choose an alternative to the default image recognition challenge.) As an example, I have converted the arithmetic test from an earlier version of captcha.module into a captcha plug-in.

AttachmentSizeStatusTest resultOperations
captcha-api.patch8.78 KBIgnoredNoneNone

#1

kps - April 16, 2005 - 22:29

Attached to this comment is an example of a module that uses the captcha interface defined in the above patch. This module encodes email addresses to protect them from spam harvesting. [Note: this example module is a work in progress.]

AttachmentSizeStatusTest resultOperations
safemail.module4.75 KBIgnoredNoneNone

#2

kps - April 16, 2005 - 22:31

Attached to this comment is a sample module that uses the hook interface defined in the patch above. This module is a plug-in captcha test that asks a simple arithmetic question; this makes the captcha module usable on systems without the GD image library. (This code is derived from an earlier version of captcha.module.)

AttachmentSizeStatusTest resultOperations
captcharith.module3.04 KBIgnoredNoneNone

#3

arnabdotorg - January 11, 2006 - 17:43
Assigned to:Anonymous» arnabdotorg
Status:needs review» active

Will be working on this for 4.7 onwards.

#4

arnabdotorg - January 30, 2006 - 16:21
Status:active» fixed

I've added this functionality to the cvs version, pl. test and confirm.

#5

Anonymous - February 13, 2006 - 16:31
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.