Comment 1 for bug 1599241

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Stephane,

For what it's worth, reCaptcha did little to stop our spam problem at mahara.org. See Bug 1252098.

That said, I suppose adding it for public comments couldn't hurt. Mahara an API for adding captcha's to forms. You just add a "captcha" pieform element to it.

Unfortunately, I tried it just now, and adding this to the comment form didn't entirely work. It displays the reCAPTCHA okay the first time you load the page, but not after you submit a comment (successfully or not). I suspect this is because we're reloading the comments section via Ajax, and my recaptcha implementation wasn't clever enough to handle that.

If anyone wants to give it a try, the starting point is this:

diff --git htdocs/artefact/comment/lib.php htdocs/artefact/comment/lib.php
index d9d2ce1..846886b 100644
--- htdocs/artefact/comment/lib.php
+++ htdocs/artefact/comment/lib.php
@@ -931,6 +931,7 @@ class ArtefactTypeComment extends ArtefactType {
                     'required' => true,
                 ),
             );
+ $form['elements']['captcha'] = array('type' => 'captcha');
         }
         $form['elements']['message'] = array(
             'type' => 'wysiwyg',