Ticket #1115: recaptcha_fix.diff
File recaptcha_fix.diff, 1.9 KB (added by , 13 years ago) |
---|
-
create_account_form.php
20 20 require_once('../inc/util.inc'); 21 21 require_once('../inc/countries.inc'); 22 22 require_once('../inc/translation.inc'); 23 require_once('../inc/recaptchalib.php'); 23 24 24 25 check_get_args(array("next_url", "teamid")); 25 26 … … 111 112 tra("Postal or ZIP Code")."<br><span class=\"description\">".tra("Optional")."</span>", 112 113 "<input type=\"text\" name=\"postal_code\" size=\"20\">" 113 114 ); 115 116 // Check if we need reCaptcha for making more safe the creation of accounts 117 $publickey = parse_config($config, "<recaptcha_public_key>"); 118 119 if ($publickey) { 120 121 row2( 122 tra("Please enter the words shown in the image"), 123 recaptcha_get_html($publickey) 124 ); 125 } 126 114 127 row2("", 115 128 "<input type=\"submit\" value=\"".tra("Create account")."\">" 116 129 ); -
create_account_action.php
20 20 include_once("../inc/util.inc"); 21 21 include_once("../inc/email.inc"); 22 22 include_once("../inc/user.inc"); 23 include_once("../inc/recaptchalib.php"); 23 24 24 25 function show_error($str) { 25 26 page_head("Can't create account"); … … 41 42 exit(); 42 43 } 43 44 45 $privatekey = parse_config($config, "<recaptcha_private_key>"); 46 if ($privatekey) { 47 $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], 48 $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"] 49 ); 50 if (!$resp->is_valid) { 51 echo "" . tra("Your reCAPTCHA response was not correct. Please try again."). ""; 52 return; 53 } 54 } 55 44 56 // see whether the new account should be pre-enrolled in a team, 45 57 // and initialized with its founder's project prefs 46 58 //