add captcha to all user created forms by default
chadd - May 7, 2008 - 15:47
| Project: | CAPTCHA |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
i see that it is quite easy to add the captcha (reCATCHA) to all user created forms (i'm using the webform module).
but i don't want to give web authors the option of not using the captcha when they create a form.
is there a way for all forms created as a webform have captcha enabled by default? is that something i can do in the content type?

#1
No, there is currently no way in the core CAPTCHA module to automatically add a CAPTCHA to a (web)form.
If you're comfortable with writing Drupal modules:
An option/workaround is to write a small helper module that sets a CAPTCHA after the webform is created,
for example by programatically submitting the captcha point form (form_id: captcha_point_admin_form) with the desired values.
I don't think this type of functionality should be in the core CAPTCHA module, it makes more sense to put it in a separate (sub)module.
#2
I would be willing to sponsor such a module for Drupal 5.x+ if anyone is interested in working on it.
#3
How about adding wildcard (or even regular expression) matching to determine placement of captcha? It will enable us to eg. add "webform_client_form_*" or "webform_client_form_%" to the list of form_ids that will get captcha. All forms matching that pattern will get a captcha. This functionality can be used for other (future) similar cases too.
Since form names are (usually and by convention) valid PHP function names, there won't be clashes with existing IDs.
#4
working with wildcards could be a possible solution, but I'm not sure yet if it is worth the extra processing it would incur (on every form). And how to handle multiple matches?