Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am starting to get several spambot registrations a day. I can use mollom to add a captcha to the standard user registration form. But, the Join and Learn block is still open for registrations without captcha.
What are the best practices for using Mollom in Commons to reduce spam registrations?
Is there a way for mollom to add a captcha to the profile page where the initial password would be set?
Comment | File | Size | Author |
---|---|---|---|
#4 | commons_core-mollom-support-join-block-1347182.patch | 958 bytes | mstef |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedThanks for pointing this out.
Looking at commons_core_join_form() it looks like Commons is overwriting any existing submission and validation callbacks, rather than adding to the ones that are already exist.
This form should probably be refactored.
Comment #2
mstef CreditAttribution: mstef commentedThe problem is that the "Join and Learn" block is not the user registration form - despite it essentially being the same thing. If you look at the code for that block, the function starts by grabbing the form array created by user_register(), but makes the necessary alterations. The reason why a form_alter cannot be used is because then the user registration block would be altered to look like this block wherever it is used.
I can think of two solutions. 1) Use the mollom API (assuming this exists) to register the Join & Learn form with Mollom or 2) do the form alter on the normal user_registration form, but use the block callback to set a static cache indicating that we're requesting the Join & Learn block. I hope that makes sense.
Comment #3
david.moore.ipg CreditAttribution: david.moore.ipg commentedMaybe just add a hidden honeypot to the form that mollom monitors and rejects if it is filled.
Comment #4
mstef CreditAttribution: mstef commentedImplemented mollom hooks to support the form.
Comment #5
ezra-g CreditAttribution: ezra-g commentedTagging this for review in time for the 2.7 release.
Comment #6
ezra-g CreditAttribution: ezra-g commentedThis is committed - Thanks.
http://drupalcode.org/project/commons.git/commit/a085efb
Comment #8
Hadi Farnoud CreditAttribution: Hadi Farnoud commentedthe patch did not solve the problem for me. is there any additional step I have to take?
Comment #9
Hadi Farnoud CreditAttribution: Hadi Farnoud commentednevermind, it was block cache. works like a charm