If anyone is using the recaptcha default in the /core/app.config.php file, It doesn’t WORK , never has since at least 5 years ago. No OFFENSE, the recaptcha key is in the app.config.php file mate, not the local.config.php file. Google offers Free keys for this, and still is, however I also have the Registration file in the core/modules/Registration.php, which I created a long time ago, it bypasses the recaptcha key all together. This One file has calls on Lines 168 to line 193 that calls the server for the key. Remark it out, but don’t delete it, below are examples of before and after. WARNING! ALWAYS BACKUP YOUR FILES ! Do remember that you are wide open without any protection without it, this will buy you some time until you get it fixed and put in your own recaptcha key. Just also so you know, you have two files you have to enter your recaptcha keys to, one is the app.config.php file and the other is the actual registration form for the site which lives in the /templates folder, its called;
registration_mainform.php , this also is actually the one that sends the actual form, I have actually entered the recaptcha key in this one file, without changing the app.config.php file, and it still worked, however change both with your new key when you get it, and you will be good to go forever, just don’t lose your 2 keys.
First file the core/modules/Registration.php this is the Original file you have…
/\* \* Process all the registration data \*/ protected function VerifyData() { $error = false; //Google reCaptcha //updated to Google noCaptcha 1/15 $resp = null; $reCaptcha = new ReCaptcha(RECAPTCHA\_PRIVATE\_KEY); // Was there a reCAPTCHA response? if ($\_POST["g-recaptcha-response"]) { $resp = $reCaptcha-\>verifyResponse( $\_SERVER["REMOTE\_ADDR"], $\_POST["g-recaptcha-response"] ); } //check if reCaptcha response was valid if ($resp == null) { $error = true; $this-\>set('captcha\_error', 'reCaptcha Validation Error'); } //end Google reCaptcha /\* Check the firstname and last name \*/
This is the second file with the changes I’ve made, again this bypassess the complete recaptcha system, still remark out the actual /templates/registration_mainform.php file where the recaptcha key lives you can’t miss it, its down at the bottom before the submit button script…here…your changes to make, pay attention to where these live on the lines…
/\* \* Process all the registration data \*/ protected function VerifyData() { $error = false; /\* Check the firstname and last name \*/ if($this-\>post-\>firstname == '') { $error = true; $this-\>set('firstname\_error', true); } else { $this-\>set('firstname\_error', ''); } /\* Check the last name \*/ if($this-\>post-\>lastname == '') { $error = true; $this-\>set('lastname\_error', true); } else { $this-\>set('lastname\_error', ''); }
You will see around lines 168 to 173 that its gone, compare the both with a editor that has line numbers, not note pad ConText Editor is freeware, great for quick edits of scripts. I use Adobe DreamWeaver which is not freeware. Note pad does work, but has no number lines obviously. Let me know if this helps, but make a copy of all original files you will be messing with first so Your Safe and poke me anytime with questions etc… hope this helps, if your unsure about this, then please get someone to help you, I would really be bummed out if you messed this up. Thanks.
Happy Holidays !!
Jim