- web: fix bug in profile creation. fixes #755

svn path=/trunk/boinc/; revision=16194
This commit is contained in:
David Anderson 2008-10-13 03:19:34 +00:00
parent 46711e4bc8
commit 210f9202ea
3 changed files with 13 additions and 3 deletions

View File

@ -8305,3 +8305,9 @@ David 12 Oct 2008
html/inc/
forum.inc
David 12 Oct 2008
- web: fix bug in profile creation. fixes #755
html/user/
create_profile.php

View File

@ -11,7 +11,7 @@ if ($host == "bolt.berkeley.edu") {
}
require_once("docutil.php");
require_once("../html/inc/translation.inc");
require_once("translation.inc");
function show_participant() {
$i = rand(0, 99);

View File

@ -201,14 +201,14 @@ function process_create_profile($user, $profile) {
$response2 = post_str('response2', true);
$language = post_str('language');
$profile->response1 = $response1;
$profile->response2 = $response2;
$privatekey = parse_config($config, "<recaptcha_private_key>");
if ($privatekey) {
$resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]
);
if (!$resp->is_valid) {
$profile->response1 = $response1;
$profile->response2 = $response2;
show_profile_form($profile,
"Your ReCaptcha response was not correct. Please try again."
);
@ -216,6 +216,8 @@ function process_create_profile($user, $profile) {
}
}
if (!akismet_check($user, $response1)) {
$profile->response1 = $response1;
$profile->response2 = $response2;
show_profile_form($profile,
"Your first response was flagged as spam by the Akismet
anti-spam system. Please modify your text and try again."
@ -223,6 +225,8 @@ function process_create_profile($user, $profile) {
return;
}
if (!akismet_check($user, $response2)) {
$profile->response1 = $response1;
$profile->response2 = $response2;
show_profile_form($profile,
"Your second response was flagged as spam by the Akismet
anti-spam system. Please modify your text and try again."