");
if ($privatekey) {
- $recaptcha = new ReCaptcha($privatekey);
- $resp = $recaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
- if (!$resp->success) {
+ if (!boinc_recaptcha_isValidated($privatekey)) {
show_error(tra("Your reCAPTCHA response was not correct. Please try again."));
}
}
diff --git a/html/user/create_account_form.php b/html/user/create_account_form.php
index 630f630c28..467aa39084 100644
--- a/html/user/create_account_form.php
+++ b/html/user/create_account_form.php
@@ -38,7 +38,7 @@ if (parse_bool($config, "no_web_account_creation")) {
error_page("This project has disabled Web account creation");
}
-page_head(tra("Create an account"), null, null, null, recaptcha_get_head_extra());
+page_head(tra("Create an account"), null, null, null, boinc_recaptcha_get_head_extra());
if (!no_computing()) {
echo "
diff --git a/html/user/create_profile.php b/html/user/create_profile.php
index 9d2d4d69f4..7b549a7853 100644
--- a/html/user/create_profile.php
+++ b/html/user/create_profile.php
@@ -20,6 +20,7 @@
require_once("../inc/profile.inc");
require_once("../inc/akismet.inc");
+require_once("../inc/recaptchalib.php");
if (DISABLE_PROFILES) error_page("Profiles are disabled");
@@ -200,9 +201,7 @@ function process_create_profile($user, $profile) {
$privatekey = parse_config($config, "");
if ($privatekey) {
- $recaptcha = new ReCaptcha($privatekey);
- $resp = $recaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
- if (!$resp->success) {
+ if (!boinc_recaptcha_isValidated($privatekey)) {
$profile->response1 = $response1;
$profile->response2 = $response2;
show_profile_form($profile,
@@ -314,9 +313,9 @@ function process_create_profile($user, $profile) {
function show_profile_form($profile, $warning=null) {
if ($profile) {
- page_head(tra("Edit your profile"), null, null, null, recaptcha_get_head_extra());
+ page_head(tra("Edit your profile"), null, null, null, boinc_recaptcha_get_head_extra());
} else {
- page_head(tra("Create a profile"), null, null, null, recaptcha_get_head_extra());
+ page_head(tra("Create a profile"), null, null, null, boinc_recaptcha_get_head_extra());
}
if ($warning) {
diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py
index 0cefe9d27d..ea0a7a9ad6 100644
--- a/py/Boinc/setup_project.py
+++ b/py/Boinc/setup_project.py
@@ -263,6 +263,8 @@ def create_project_dirs(dest_dir):
'html',
'html/cache',
'html/inc',
+ 'html/inc/ReCaptcha',
+ 'html/inc/ReCaptcha/RequestMethod',
'html/languages',
'html/languages/compiled',
'html/languages/translations',
@@ -314,6 +316,8 @@ def install_boinc_files(dest_dir, install_web_files, install_server_files):
if install_web_files:
install_glob(srcdir('html/inc/*.inc'), dir('html/inc/'))
install_glob(srcdir('html/inc/*.php'), dir('html/inc/'))
+ install_glob(srcdir('html/inc/ReCaptcha/*.php'), dir('html/inc/ReCaptcha/'))
+ install_glob(srcdir('html/inc/ReCaptcha/RequestMethod/*.php'), dir('html/inc/ReCaptcha/RequestMethod'))
install_glob(srcdir('html/inc/*.dat'), dir('html/inc/'))
install_glob(srcdir('html/ops/*.css'), dir('html/ops/'))
install_glob(srcdir('html/ops/ffmail/sample*'), dir('html/ops/ffmail/'))