Hey All,
This is Pari, been on this forum since the beginning but had to create a new account on this new forum.
Anyway, I was wondering if anyone has modded Google reCaptcha into eFicition yet? I would appreciate any help as I am finding the built-in captcha is not stopping spam. I have had to turn off registration and reviews because it has gotten so bad.
Thank you 🙂
I found that it is already existing. Maybe you could ask somebody from this thread:
Oh, and write your PHP version please, thanks
I am having this issue too, @Parisian. My host took my site down because someone was using our contact form to spam users, ad the only way they will put it back up is to add recaptcha to the contact form. I did not find the solution on the linked page above.
Thanks in advance to anyone who can help.
psymom
www.twilighted.net
I found that it is already existing. Maybe you could ask somebody from this thread:
Oh, and write your PHP version please, thanks
Thank you, and sorry I am running eFiction version 3.5.3.
I am having this issue too, @Parisian. My host took my site down because someone was using our contact form to spam users, ad the only way they will put it back up is to add recaptcha to the contact form. I did not find the solution on the linked page above.
Thanks in advance to anyone who can help.
psymom
www.twilighted.net
Oh wow, I am very sorry about that @psymommy 🙁 The captcha for eFiction seems so complicated when I looked through the files to see if I could integrate recaptcha in it somehow. But it has not stopped spam at all. The spammage has gotten out of hand for me 🙁
Don't be sorry... please, I would like to help, but I need to know PHP version of your server (PHP 5.x or PHP 7.x). And any old recapcha mod would be great help, I can fix things but I am not sure about creating new ones. According that other topic, it should be some available.
Don't be sorry... please, I would like to help, but I need to know PHP version of your server (PHP 5.x or PHP 7.x). And any old recapcha mod would be great help, I can fix things but I am not sure about creating new ones. According that other topic, it should be some available.
Php Version is php 7.x
I think I have figured it out, at least it works for me 🙂
*BACKUP YOUR FILES. Download a copy of the 'editbio.php' page found in the 'User' folder first
This is assuming you've already gotten your reCaptcha site key and secret key. If not you have to do that first by going here and signing up:Google ReCaptcha
Now, go to the User folder and open 'editbio.php'
right under the top section with the info about efiction script, right beneath this // ----------------------------------------------------------------------
I put this code:
if(isset($_POST['g-recaptcha-response'])) {
// RECAPTCHA SETTINGS
$captcha = $_POST['g-recaptcha-response'];
$ip = $_SERVER['REMOTE_ADDR'];
$key = 'INSERT SECRET KEY HERE';
$url = 'https://www.google.com/recaptcha/api/siteverify';
// RECAPTCH RESPONSE
$recaptcha_response = file_get_contents($url.'?secret='.$key.'&response='.$captcha.'&remoteip='.$ip);
$data = json_decode($recaptcha_response);
if(isset($data->success) && $data->success === true) {
}
else {
die('Your account has been logged as a spammer, you cannot continue!');
}
}
Take note of the red text, literally insert the secret key Google ReCaptcha assigned to you
Now, in the same 'editbip.php' page find this area:
$output .= "<div style='text-align: center; margin: 1em;'><INPUT type=\"hidden\" name=\"uid\" value=\"".(isset($user) ? $user['uid'] : "")."\"><INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">";
Replace it with this:
$output .= "<div style='text-align: center; margin: 1em;'><INPUT type=\"hidden\" name=\"uid\" value=\"".(isset($user) ? $user['uid'] : "")."\"><div class=\"g-recaptcha\" data-sitekey=\"INSERT SITE KEY HERE\"></div><br/><INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">";
Again, take note of the red text, literally insert the site key Google ReCaptcha assigned to you
Save editbio.php and then test it out. Like I said this worked for me. When I fill out all the required fields in efiction but don't check the recaptcha it takes me to a page that says, "Your account has been logged as a spammer, you cannot continue!" When I have filled out all the required field in Efiction and check the reCaptcha account is created and I am redirected to log in page
Share your feedback on this if it works for you or not.
Thanks
Forgot to add that you need to add this to your header.php, will not work without it:
echo "<script src='https://www.google.com/recaptcha/api.js'></script>";
@parisian Bless You!
We just had a mass spam attack last night and I was frantically coming here to search up reCaptcha.
I'm sorry to hear you got Spammied, I know the feeling well 🙁 I hope the reCaptcha code works for you okay.
Forgot to add that you need to add this to your header.php, will not work without it:
echo "<script src='https://www.google.com/recaptcha/api.js'></script>";
I have been trying to figure out how to implement reCaptcha into the efiction script for literally a couple of years now, with no luck. And two days ago thanks to hours of Google searches and YouTube I finally found the help I needed. And of course it was so much easier than I was making it out to be 😀
Let us know if it works for you. So, far I only have myself to validate it is working 🙂