|
#51
|
||||
|
||||
Quote:
Code:
$response = $_POST["g-recaptcha-response"]; you well need to use the Code:
$recaptcha_response_field
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#52
|
|||
|
|||
Quote:
I've added the following to debug it but I'm not understanding the issue yet. //echo "<pre>"; //print_r($_POST); and //testing to see if response working. comment out once working echo "<pre>"; print_r($response); I thought I just use the $recaptcha_response_field for the response varible but even that doesn't produce a success for the response here's what i see from the class_captcha.php response //echo "<pre>"; //print_r($_POST); CAPTCHA success failing //testing to see if response working. comment out once working echo "<pre>"; print_r($response); Bump: I have fixed this and here's how. the _POST of the variables to the response was not being assigned for some reason when calling ajax/signup.php at sigup and running the library/class_captcha.php I simply made a variable in ajax/signup.php to assign the response to and that got ride the response not assigned error edited working class_captcha.php Code:
<?php class TSUE_captcha { public function verifyCaptcha($recaptcha_challenge_field, $recaptcha_response_field) { // //PUT YOUR PRIVATE KEY HERE// $secret = "6LcsM2gUAAAAAAjbvuAs-YtADTLyAKkG96AX8nmK"; // // // global $_POST; $remoteip = $_SERVER["REMOTE_ADDR"]; $url = "https://www.google.com/recaptcha/api/siteverify"; // Curl Request $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, array( 'secret' => $secret, 'response' => $recaptcha_response_field, 'remoteip' => $remoteip )); $result = curl_exec($curl); curl_close($curl); $result = json_decode($result); //echo "<pre>"; //echo print_r($recaptcha_response_field); //echo print_r($result); //echo "<pre>"; if ($result -> success) { return true; } else { return false; } } } ?> edited ajax/signup.php - search for $_POST["g-recaptcha-response"]; in ajax/signup.php - created a variable $recaptcha_response_field = $_POST["g-recaptcha-response"]; - edit if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $_POST["g-recaptcha-response"];)) and make it - if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $recaptcha_response_field)) Bump: Here's the updated TSUE v2.2 source code with Recaptcha v2 working - Complete with files updated included that joe made with one minor edit to /ajax/signup.php - Updated default database with template edits already done so you dont have to do them. only the public key entry in captcha template 1. Extract and upload directory to your domain web host 2. Create a database in CPANEL 3. Use MyPHPAdmin and Import default database file to your newly created database 4. Run installer: https://yourdomainnamehere.com/tsue_install/install.php 5. Make a Google Recaptcha key pair for your domain - Edit template named captcha and put in your and public captcha key - Edit /library/classes/class_captcha.php and put in your private captcha key 6. Proceed as normal Credits to joe roberts for file updates and Napon for his work. Code:
https://my.pcloud.com/publink/show?code=XZVvdW7ZO707LfnGq6L3cvv6lbVjN7gc9Sak use this to resize the captcha. note: this is the catpcha part edited in the template. don't forget to enter your site key of course. Code:
<div class="g-recaptcha" data-theme="light" data-sitekey="XXXXXXXXXXXXX" style="transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div> |
Tags |
22 , recaptcha , tsue |
|
|