chuliano Posted December 7, 2014 Share Posted December 7, 2014 Hello, I'm working on a recaptcha upgrade: google recaptcha V2 Link information: https://developers.google.com/recaptcha/ OK edit the "recaptchalib.php" file in: "includeslibrecaptcha" in line 97 aprox function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) { if ($pubkey == null || $pubkey == '') { die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>"); } if ($use_ssl) { $server = RECAPTCHA_API_SECURE_SERVER; } else { $server = RECAPTCHA_API_SERVER; } $errorpart = ""; if ($error) { $errorpart = "&error=" . $error; } /*return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script> <noscript> <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/> </noscript>';*/ return ' <div class="g-recaptcha" data-sitekey="MY_KEY(change my key)"></div> <noscript> <div style="width: 302px; height: 352px;"> <div style="width: 302px; height: 352px; position: relative;"> <div style="width: 302px; height: 352px; position: absolute;"> <iframe src="https://www.google.com/recaptcha/api/fallback?k=MY_KEY(change my key)" frameborder="0" scrolling="no" style="width: 302px; height:352px; border-style: none;"> </iframe> </div> <div style="width: 250px; height: 80px; position: absolute; border-style: none; bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;"> <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 80px; border: 1px solid #c1c1c1; margin: 0px; padding: 0px; resize: none;" value=""> </textarea> </div> </div> </div> </noscript>'; } edit "controllercontroller.index.inc.php" in line 62 aprox $GLOBALS['recaptcha_keys'] = array('captcha_private' => 'MY_NEW_KEY_PRIV', 'captcha_public' => 'MY_NEW_KEY_PUB'); and also this one in the "skin" folder: "templatecontent.recaptcha.php" change everything for this code {if $RECAPTCHA} <fieldset id="recaptcha-title"> <legend>{$LANG.form.verify_human}</legend> {$DISPLAY_RECAPTCHA} </fieldset> {/if} BUT... show the same error text "The verification code was incorrect. Please try again." Anyone know if this is possible to update or can not? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2014 Share Posted December 7, 2014 Is there supposed to be some javascript that is sourced from Google that looks for and populates this div:<div class="g-recaptcha" data-sitekey="MY_KEY(change my key)"></div> Quote Link to comment Share on other sites More sharing options...
chuliano Posted December 7, 2014 Author Share Posted December 7, 2014 yes, but still not working Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 7, 2014 Share Posted December 7, 2014 Please examine the actual HTML as shown in your browser. This may be a case where the new code is not getting rendered in the template because CubeCart is using a cached copy of the template. If the browser's Show Source reveals that the page is still using the stock reCaptcha, then in admin, Maintenance, Rebuild tab, Clear the cache. Quote Link to comment Share on other sites More sharing options...
chuliano Posted December 7, 2014 Author Share Posted December 7, 2014 yes i try, even try in chrome mode incognito, but still fail. I will keep trying Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.