Attached patch introduces a separate setting to also allow enabling captcha challenges on administrative forms. That might sound awkward in the first place, but it's badly needed for public demonstration sites.
The Drupal Administration Menu showcase site is a popular example of a public demonstration that allows untrusted users to access certain areas of Drupal's administration pages. As you can see there, the patch is already implemented and doing a good job.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 229710_admin_too.patch | 1.06 KB | soxofaan |
| #4 | captcha-DRUPAL-5--3.patch | 1.15 KB | sun |
| captcha-DRUPAL-5--3.admin_.patch | 3 KB | sun |
Comments
Comment #1
soxofaan commentedI'm not really convinced that it would be a good idea to add this to the "official" version.
If you let untrusted user poke around in administrative pages, I don't know what CAPTCHA could protect, as will only keep bots out, while evil human are not stopped. It could only prevent automated nuking of the demosite.
There are some usability issues with the current CAPTCHA admin, generally people not getting the concept of the CAPTCHA adminstrative links. Adding this patch would only make the admin interface harder and more bloated. So I think the patch would make it worse for more people than it would be good for the (only the exotic use case of demo sites).
Moreover I think the elseif condition in the patch is wrong and should be something like
Comment #2
sunUnderstood. How about a direct integration of both modules? Would you be open to implement a module_invoke(), so Demo is able to alter Captcha's settings form and add this optional setting?
Comment #3
soxofaan commentedThere is actually already sort of a workaround.
It's only the CAPTCHA administration links that do not show up on the admin pages. If a challenge is however is set on an admin page, it will show up for untrusted users. The only tricky thing is how to enable a challenge on an admin page if there are no adminsitration links. It's possible, but not obvious. You need at least the form_id of the form you want to add a CAPTCHA to. Then you have two options (for version 5.x-3.x):
in the 6.x-1.x and HEAD version there is also an extra form for adding arbitrary form_id's (see http://drupal.org/node/214557).
Hope this gives some inspiration on how to solve this
Comment #4
sunSorry, but that does not help users of Demo who want to guard their site. While Demo could support a single option to "Enable CAPTCHA administration links on administrative forms" (instead of CAPTCHA), it certainly won't support a form selection/storage mechanism. Implementing support for Form controller in CAPTCHA would be an option, but that's a completely different topic.
Currently, I can only imagine to add
variable_get('captcha_administration_admin_mode', FALSE)to the condition you already mentioned in #1 (like in the patch) as a hidden setting, without providing a configurable option in CAPTCHA's settings.Comment #5
soxofaan commentedAnother solution I can think of is that the demo module adds the CAPTCHA administration links to the admin forms.
To make this easier, I could refactor the CAPTCHA administration link adding code into a function so you only need to call one function.
I still think you forgot a check for
arg(0) != 'admin'in the patch from #4see attached patch
Comment #6
soxofaan commentedFYI
the patches at http://drupal.org/node/214557#comment-777749 make it possible to add arbitrary form_id's with a simple form (http://drupal.org/files/issues/captcha_point_add_snapshot6.png)
would this be of any help or is obtaining a form_id from a form too difficult for your intended users?
Comment #7
soxofaan commentedduplicate of #287907: admin CAPTCHA preview, CAPTCHAs for admins, demo site CAPTCHAs and #445026: Allow CAPTCHAs on Admin Pages