Hey, this is just an add-on to the MapleBit register script that will allow it to use the Google ReCAPTCHA instead of the old (ugly) one.
Step 1 : Getting Keys
Just go to https://www.google.com/recaptcha/admin and fill out the form. Once it's finished you will receive a page that shows you 2 KEYS. You will need both the public and secret key in-order for this to work properly. Just copy both of them on a notepad file for now, until we get to the last step!
Step 2 : Adding in Google's Api.js
Spoiler:
Step 3 : Replacing register scriptSpoiler:
Step 4 : Changing Public/Secret Keys Now that we have replaced the script, we are ready to change the ReCAPTCHA keys (both public and secret) that we created in Step 1.
First navigate to line 30 within the script and place your PUBLIC key where it says "YOUR SITE KEY HERE"
Now go to line 40 and edit where it says "YOUR SECRET SITE KEY" with your SECRET key.
Just save and refresh the register page, and it should work flawlessly!
Credits : greenelfx (for MapleBit)
Last edited by vZero; 19-08-15 at 03:43 AM.
Nice, thanks for posting!
Though I can't understand why replace the entire registration script instead of just modify the script and add the api request, it will mess things up for people who have modifications in their registration script (i.e. adding other data fields, etc).
PHP<3
Looking for PHP developers for code reviews, PM me
Last edited by vZero; 19-08-15 at 03:45 AM.
You should add something in here or else remove this snippet of the coding.PHP Code:
}
else{
// ReCAPTCHA Failed
}
For anyone who has an error with line 70
use this instead:PHP Code:
if($response.success==true)
And there's another minor error with line 5PHP Code:
$response = json_decode($response, true);
if($response['success'])
Just replace it with this:PHP Code:
echo "<meta http-equiv=refresh content="0; url=?base=ucp">";
PHP Code:
echo "<meta http-equiv=refresh content=\"0; url=?base=ucp\">";
I wasn't aware that this was possible without using Composer. Great work!
Every time I look at MapleBit's code I cringe :(. Once all the minor issues are fixed feel free to submit a PR
Last edited by greenelfx; 19-08-15 at 04:09 PM.
You can't use double quotes within double quotes without escaping it, however you can use single quotes within double quotes without the need to escape it.
It will just shorten the code a bit (by 2, lol), though it's just the "proper" way to write it but it doesn't really matter.
PHP<3
Looking for PHP developers for code reviews, PM me
I'm getting this error:
Anyone know how to fix it?
replace register.php with -
https://pastebin.com/2caDrWYU
its give erors , line 8 , u have fix?
Last edited by Mapleleaf1; 04-04-18 at 08:14 PM.