News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

reCAPTCHA for SMF

Started by 青山 素子, December 28, 2007, 12:16:40 PM

Previous topic - Next topic

ZamaTata

Thanks working fine in my newly installed 2.0.11 forum.


Nirose

This does not work for me on my forum. i keep getting "letters not matched errors".

But recaptcha doesn't use letters anymore and it uses tick or visual verification. It would be great if it worked as ticking is the simplest way for anti-bot.

Anyone have any clue?

vbgamer45

Played around a bit with v2 of recaptcha.
One big thing to note is they took away global keys. You now have to list each domain so that sucks. Did find a workaround though you have to create a secure token.
Here is a the lib samples with ReCaptchaToken.php included.

I did something like this on my sites

global $sourcedir;
require("$sourcedir/ralib/ReCaptchaToken.php");


$reconfig = array('site_key' => $modSettings['recaptcha_public_key'], 'site_secret' => $modSettings['recaptcha_private_key']);
$recaptchaToken = new \ReCaptchaSecureToken\ReCaptchaToken($reconfig);
$secureToken = $recaptchaToken->secureToken($context['session_id']);

echo '            <div class="g-recaptcha" data-sitekey="', $modSettings['recaptcha_public_key'], '" data-stoken="' .  $secureToken  . '"></div>
            <script type="text/javascript"
                    src="https://www.google.com/recaptcha/api.js?hl=en">
            </script>

register.php

require("$sourcedir/ralib/autoload.php");

// Check whether the visual verification code was entered correctly.
if(!empty($modSettings['recaptcha_enable']) || ($modSettings['recaptcha_enabled'] == 1 && !empty($modSettings['recaptcha_public_key']) && !empty($modSettings['recaptcha_private_key'])))
{
if (isset($_POST['g-recaptcha-response']))
{
$recaptcha = new \ReCaptcha\ReCaptcha($modSettings['recaptcha_private_key']);
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);

if ($resp->isSuccess() == false)
{
fatal_lang_error('visual_verification_failed', false);
}



}
else
fatal_lang_error('visual_verification_failed', false);



}
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

青山 素子

Google took down all their documentation on using secure tokens. As far as I'm concerned, that makes such an option officially unsupported and likely to go away. Anyone is welcome to try and do this on their site, but I'm not planning on adding undocumented features that are subject to breakage. Should this get added back to the official documentation, let me know and I'll see about adding it officially.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


kovaldo

After upgrading to PHP 7
Version: reCAPTCHAforSMF_1.0.1

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor in ~/Sources/recaptchalib.php on line 42

青山 素子

Thanks for the information. That's a Google-supplied library. Hopefully, they'll update the code before it's removed from PHP.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


PPZ-01

Quote from: Nirose on February 04, 2016, 12:01:23 AM
This does not work for me on my forum. i keep getting "letters not matched errors".

But recaptcha doesn't use letters anymore and it uses tick or visual verification. It would be great if it worked as ticking is the simplest way for anti-bot.

Anyone have any clue?

   I have the same problem.Removed ReCaptcha for the moment, as it is useless as it is.It would be nice to have some solution, as it looks quite ok.

vbgamer45

That I have sometimes seen occur if you have bad html on the page unclosed tags could mess with recaptcha
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

青山 素子

I'd love to find a way to fix, but I can't reproduce the issue.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


PPZ-01

Quote from: vbgamer45 on April 05, 2016, 09:59:03 PM
That I have sometimes seen occur if you have bad html on the page unclosed tags could mess with recaptcha

   I did the fresh install, with minimal modifications.Before reCaptcha i tried KeyCaptcha mod, but removed it, and then installed reCaptcha.

   All mods were uninstalled without problem, no errors, and new ones were installed through the package manager.

   So I don't know if any of mods broke the code, but they all seem to work fine, except reCaptcha.

   

vbgamer45

I would try running your site though the html validator there is an icon/link in your theme normally near the bottom. but you need to run in on the registration page
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

PPZ-01

     I have to admit it is out of my powers.I am not so advanced in programming that I can find the error.

    Obviously there is some, but I not find it.

     If anyone is interested to check it for me, url is:

     http://www.citroenforumsrbije.com/index.php?action=register

garyee

Hello,

I installed the reCaptcha Mod primarily for guest posting, but now I noticed that there is an error when using the reCaptcha for guest search validation.
Anything I do results in the error message:
"Please enter the verification code below to continue to the results."

I do not know if this error only occurs on my installation, or in general.
Does anyone have this problem too, or knows a solution?

I am using SMF 2.0.11 and the Mod Version from  reCAPTCHAforSMF_1.0.1.tar.gz (in the package manager it says 1.0.0 anyhow... which is also kind of strange)



nothus

Not working on my registration page, always getting "wrong letters error"
When i validate my registration page i get :

Error Line 192, Column 43: there is no attribute "data-sitekey"
...<div class="g-recaptcha" data-sitekey="6Lch9R8......

Error Line 192, Column 97: there is no attribute "data-theme"
...ata-sitekey="6Lch9R8......" data-theme="dark"></div>


MobileCS

This mod is not working on my site either. When enabled, I keep getting the "wrong letters error" when trying to register.

Its like the built in captcha is still activated - but not showing.

PPZ-01

   Me too, but it seems no support on this :(

   Too bad, I was eager to implement it into forum.

   Right now I set three questions on regsitration, so a little bit less spammers, but still I would like to be able to use reCAPTCHA. :(

青山 素子

It should be working, but I'll check as soon as I can. The failure message is recycled from the default strings for the built-in system, so that's why it talks about letters.

I maintain this in my free time and have been working 12-16 hour days recently, leaving no time for anything else.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


PPZ-01

      I can enable reCAPTCHA for a few days if you wish to check what's up, just tell me when :)

b33z

Quote from: [Lucien] on January 24, 2011, 09:50:01 PM
Quote from: king kratos on January 11, 2011, 05:13:54 PM

Ok, I got it installed on my forum, but it is not centered. I attempted to add align=center and <center> but it still won't center. Any suggestions?

Kratos

Open this file in a editor: Themes/default/GenericControls.template.php

Search:

<div id="verification_control_', $i, '" class="verification_control">';

Replace with:

<div align="center" id="verification_control_', $i, '" class="verification_control">';



I found this info here.... http://www.simplemachines.org/community/index.php?topic=379963.msg2617402#msg2617402


Thats it! Thats the bit we've been looking for lol I don't care how late to the party I am!

Cheers!

I JaR oF JaM I

When I try to register a new account with this mod, it says "You are not allowed to access this section."   Any idea why?
Death smiles at us all... All we can do is smile back.

Advertisement: