Advertisement:

Author Topic: reCAPTCHA for SMF  (Read 415929 times)

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,423
  • Gender: Male
    • i30 Owners Club
Re: reCAPTCHA for SMF
« Reply #940 on: August 21, 2019, 01:32:10 PM »
I found a bug that prevents the verification questions from displaying properly (if enabled).

This line:
Code: [Select]
$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;

Needs to be changed to:
Code: [Select]
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;

in GenericControls.template.php


https://www.simplemachines.org/community/index.php?topic=213535.msg3992720#msg3992720

Offline szinski

  • Jr. Member
  • **
  • Posts: 116
  • Gender: Male
  • Programmer by day, photographer by night.
    • Pizza Making
Re: reCAPTCHA for SMF
« Reply #941 on: August 21, 2019, 01:38:04 PM »
Thanks, looks I missed that and had to figure it out on my own.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: reCAPTCHA for SMF
« Reply #942 on: October 03, 2019, 11:26:27 AM »
I'm having an issue :) (imagine that)

so I turned of smf captcha and I turned off the questions
and enabled this mod

but when trying to register I keep getting

The following errors were detected in your registration. Please correct them to continue:
Please enter the verification code below to continue to the results.

yes I clicked the box that i'm not a robot but it still just keeps giving this error..... if i turn this mod off (no captcha's) registration works....but obviously I don't want to do that

2.0.15 (many many mods)

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: reCAPTCHA for SMF
« Reply #943 on: October 19, 2019, 01:55:51 PM »
I'm having an issue :) (imagine that)

so I turned of smf captcha and I turned off the questions
and enabled this mod

but when trying to register I keep getting

The following errors were detected in your registration. Please correct them to continue:
Please enter the verification code below to continue to the results.

yes I clicked the box that i'm not a robot but it still just keeps giving this error..... if i turn this mod off (no captcha's) registration works....but obviously I don't want to do that

2.0.15 (many many mods)

sorry to bump this, but can anyone try to help me with this?
I am not able to use smf captcha (not sure what broke that) and now this mod no longer works (not sure what broke it either)

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: reCAPTCHA for SMF
« Reply #944 on: December 14, 2019, 12:51:17 PM »
I found a bug that prevents the verification questions from displaying properly (if enabled).

This line:
Code: [Select]
$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;

Needs to be changed to:
Code: [Select]
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;

in GenericControls.template.php


https://www.simplemachines.org/community/index.php?topic=213535.msg3992720#msg3992720


szinski this work for me:
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;
Shambles this dont work for me:
$qIndex = $verify_context['use_recaptcha'] ? qIndex - 1 : qIndex;

How to create Recaptha + Visual + Question?

Offline SN

  • Jr. Member
  • **
  • Posts: 399
  • Gender: Male
  • ยป To Dare is To Do
    • SpursNetwork - Tottenham Hotspurs Fansite
Re: reCAPTCHA for SMF
« Reply #945 on: February 24, 2020, 12:58:10 PM »
What's your antispam setup configured as?

Mine is set to:

Use reCAPTCHA Verification System:    checked
Visual verification image to display:    none
Number of verification questions user must answer:    2

With those, the amendment I have in GenericControls.template.php is

Code: [Select]
// Where in the question array is this question?
$qIndex = ($verify_context['show_visual'] || $verify_context['use_recaptcha']) ? $i - 1 : $i;


... and it all works fine. For me. With those settings.
Thanks that worked for me..

Hi everyone,
I tried as described in the post above but it doesn't work for me...

I use SMF 2.0.15 and I have a problem, when I use the "recaptcha for smf" mod ... in the SMF AntiSpam settings i use these settings: "img. cattura0"... And I get this error: "img. cattura2"... I believe the error refers to the response field I don't answer "Img. cattura1", but I don't have any questions set, do you think I am wrong in the configuration? ... or is it a problem of the mod or of the theme or of SMF? ... Is there a way to solve this problem? Thanks for any suggestions

Im getting the same issue also. I tried the suggested solutions. Still not working for me

Offline statusjpn

  • Semi-Newbie
  • *
  • Posts: 16
Re: reCAPTCHA for SMF
« Reply #946 on: February 25, 2020, 10:28:14 AM »
Tried @Shambles' fix and it only fixed part of the issue.

1) Previously when i enable reCAPTCHA and had a question, the question appeared blank with only the answer box - this has now been FIXED with @Shambles' post and the security question appears correctly

2) However, after clearing the reCAPTCHA and answering the security question, it still prompts the error:

Quote
The following errors were detected in your registration. Please correct them to continue:
The letters you typed don't match the letters that were shown in the picture.

Anyone has a fix for problem #2?

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 112
Re: reCAPTCHA for SMF
« Reply #947 on: March 20, 2020, 06:34:50 AM »
Code: [Select]
https://xxx/forum/index.php?action=register2
2: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
File: /home/xxx/public_html/forum/Sources/recaptcha/ReCaptcha/RequestMethod/Post.php
Line: 68

with following:
Code: [Select]
https://xxx/forum/index.php?action=register2
2: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: no suitable wrapper could be found
File: /home/xxx/public_html/forum/Sources/recaptcha/ReCaptcha/RequestMethod/Post.php
Line: 68

fopen is "on"
This happened after update to 2.0.17 and enabling PHP 7.2

Any ideas?

Thanks

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,423
  • Gender: Male
    • i30 Owners Club
Re: reCAPTCHA for SMF
« Reply #948 on: March 20, 2020, 07:30:06 AM »
Quote
fopen is "on"

You need to confirm that by doing a phpinfo and examining the output.

What is a phpinfo() file?

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 112
Re: reCAPTCHA for SMF
« Reply #949 on: March 20, 2020, 11:02:02 AM »
Actually hosting overrides fopen parameter to be off for security reasons, so you are right.

There are apparently fixes for recaptcha which removes that dependency on fopen parameter:
https://github.com/q2a/question2answer/issues/300

Offline cortez

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 112
Re: reCAPTCHA for SMF
« Reply #950 on: March 20, 2020, 12:04:03 PM »
Fixed by integrating latest request/response files from github:
https://github.com/google/recaptcha/tree/master/tests/ReCaptcha

Error not occuring anymore, fopen is still off for logical security reasons.

Offline Thaxos

  • Semi-Newbie
  • *
  • Posts: 30
Re: reCAPTCHA for SMF
« Reply #951 on: March 26, 2020, 02:37:44 AM »
After installing this mod it drastically cut down on the spambots however I still find my forum receiving around 1-3 spam users a day...

Verified that the reCaptcha is indeed working on registration, but some are getting by somehow.

Any thoughts on how this might be occurring?

Offline Kolya

  • Full Member
  • ***
  • Posts: 447
  • systemshock.org
Re: reCAPTCHA for SMF
« Reply #952 on: March 29, 2020, 08:52:28 AM »
It happens because these "spambots" are actually humans. There is a whole industry in low wage countries that employs people to act as spammers or to let spambots into websites, past any bot counter measures.

Accordingly these cannot be beaten with automated tests. They can however be beaten rather easily with human interaction. For example you can add a text field to your registration form (doesn't require any mods) and ask people to explain why they want to join your forum. Then review these submissions.