Advertisement:

Author Topic: reCAPTCHA for SMF  (Read 411460 times)

Offline ZamaTata

  • Semi-Newbie
  • *
  • Posts: 25
Re: reCAPTCHA for SMF
« Reply #760 on: December 14, 2015, 05:09:25 AM »
Thanks working fine in my newly installed 2.0.11 forum.


Offline Nirose

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
    • The Jucktion
Re: reCAPTCHA for SMF
« Reply #761 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?

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,626
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: reCAPTCHA for SMF
« Reply #762 on: March 05, 2016, 06:27:55 PM »
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
Code: [Select]
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
Code: [Select]
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

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,072
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #763 on: March 06, 2016, 04:53:44 PM »
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.


Offline kovaldo

  • Newbie
  • *
  • Posts: 1
Re: reCAPTCHA for SMF
« Reply #764 on: March 21, 2016, 09:23:49 AM »
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

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,072
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #765 on: March 23, 2016, 01:23:15 AM »
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.


Offline PPZ-01

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #766 on: April 05, 2016, 08:50:39 PM »
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.

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,626
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: reCAPTCHA for SMF
« Reply #767 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
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

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,072
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #768 on: April 06, 2016, 02:03:52 AM »
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.


Offline PPZ-01

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #769 on: April 06, 2016, 03:48:14 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.

   

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,626
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: reCAPTCHA for SMF
« Reply #770 on: April 06, 2016, 04:03:19 PM »
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

Offline PPZ-01

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #771 on: April 07, 2016, 03:38:38 PM »
     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

Offline garyee

  • Semi-Newbie
  • *
  • Posts: 18
Re: reCAPTCHA for SMF
« Reply #772 on: April 28, 2016, 05:47:51 AM »
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)



Offline nothus

  • Newbie
  • *
  • Posts: 1
Re: reCAPTCHA for SMF
« Reply #773 on: May 15, 2016, 08:09:28 AM »
Not working on my registration page, always getting "wrong letters error"
When i validate my registration page i get :
Code: [Select]
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>


Offline MobileCS

  • Jr. Member
  • **
  • Posts: 165
Re: reCAPTCHA for SMF
« Reply #774 on: May 24, 2016, 12:47:05 AM »
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.

Offline PPZ-01

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #775 on: May 31, 2016, 08:22:34 AM »
   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. :(

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,072
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: reCAPTCHA for SMF
« Reply #776 on: May 31, 2016, 11:57:19 AM »
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.


Offline PPZ-01

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #777 on: May 31, 2016, 12:43:10 PM »
      I can enable reCAPTCHA for a few days if you wish to check what's up, just tell me when :)

Offline b33z

  • Semi-Newbie
  • *
  • Posts: 41
  • ScifiUnited.Net -Uniting Science Fiction Fans
    • ScifiUnitedNet on Facebook
    • @ScifiUnitedNet on Twitter
    • ScifiUnited.Net
Re: reCAPTCHA for SMF
« Reply #778 on: July 06, 2016, 12:22:54 AM »

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:

Code: [Select]
<div id="verification_control_', $i, '" class="verification_control">';
Replace with:

Code: [Select]
<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!

Offline I JaR oF JaM I

  • Jr. Member
  • **
  • Posts: 178
  • Gender: Male
    • The Underground
Re: reCAPTCHA for SMF
« Reply #779 on: September 28, 2016, 02:20:37 AM »
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.