I've written an reCaptcha addon for Elkarte using the v2 Google reCaptcha service which uses a checkbox instead of verification text for most uses it deems to be likely human.
Grab the addon: https://github.com/Xydre/elkarte-recaptcha
(http://i.imgur.com/ssqe08U.png)
Nice to see new ways to fight spam! :D
Got a few errors for each person that tries to register:
Here is my reCaptcha.class.php file, too.
I would change the block:
public function doTest()
{
$this->_recaptcha = new ReCaptcha($this->_secret_key);
if ($_POST["g-recaptcha-response"]) {
$resp = $this->_recaptcha->verifyResponse (
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
if (!$resp->success)
return 'wrong_verification_code';
return true;
}
to:
public function doTest()
{
$this->_recaptcha = new ReCaptcha($this->_secret_key);
if ($_POST["g-recaptcha-response"]) {
$resp = $this->_recaptcha->verifyResponse (
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
if (!$resp->success)
return 'wrong_verification_code';
}
else
return 'wrong_verification_code';
return true;
}
Still getting 2 errors for line 58:
if ($_POST["g-recaptcha-response"]) {
1 error per person, so we almost there. ;D
I guess:
if (!empty($_POST["g-recaptcha-response"])) {
:D
That did the trick, it seems. At least, for test account I just did. :)
A bump!
I made a few updates to this package and put it on the addon site http://addons.elkarte.net/security/reCaptcha.html
This update allows you to specify the language code (from google) and uses ElkArtes functions for posting the form data back to Google, and loads as a deferred/async script.
Hi Spuds -
Just installed the package. On the page you referenced, there is a screenshot showing where to enable/disable this package and to add the key pair . However, I don't see a way to get to this screen from the install. How do you get to that screen?
It should be under
Admin -> Security and Moderation -> Anti Spam
on that screen, at the bottom is where it should show up ... if not then I made a mistake when I put the package together !
@billwill it's in Configuration > Security and Moderation > Anti Spam.
And there it is. Thanks kucing!
Great! A new way to prevent spam. Please keep improving on this.
Updated package for ElkArte 1.1 ( http://addons.elkarte.net/security/reCaptcha.html )
Thanks Spuds I needed that 8)
Hi, bumping this.
Maybe there is a bug. If this addon activated, then question and answer will be gone.