From 73791391f65a7674e6b9c9438d87ec4feb2ee0c6 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Mon, 1 Apr 2013 21:57:13 -0400 Subject: [PATCH] Add captcha feature Added re-captcha to the user profile form with the spam controls feature --- .../spam_controls/spam_controls.features.captcha.inc | 2 +- .../user_profiles/user_profiles.features.content.inc | 2 +- .../default/boinc/modules/boincuser/boincuser.module | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drupal/sites/all/features/spam_controls/spam_controls.features.captcha.inc b/drupal/sites/all/features/spam_controls/spam_controls.features.captcha.inc index bb9949fae9..206aabe034 100644 --- a/drupal/sites/all/features/spam_controls/spam_controls.features.captcha.inc +++ b/drupal/sites/all/features/spam_controls/spam_controls.features.captcha.inc @@ -8,7 +8,7 @@ function spam_controls_captcha_default_points() { 'edit_profile_node_form' => array( 'form_id' => 'edit_profile_node_form', 'module' => NULL, - 'captcha_type' => 'default', + 'captcha_type' => NULL, ), ); } diff --git a/drupal/sites/all/features/user_profiles/user_profiles.features.content.inc b/drupal/sites/all/features/user_profiles/user_profiles.features.content.inc index addb841071..1c798dcdaf 100644 --- a/drupal/sites/all/features/user_profiles/user_profiles.features.content.inc +++ b/drupal/sites/all/features/user_profiles/user_profiles.features.content.inc @@ -625,7 +625,7 @@ Zimbabwe|Zimbabwe', 'allowed_values_php' => '', 'widget' => array( 'rows' => 5, - 'size' => '60', + 'size' => '42', 'default_value' => array( '0' => array( 'value' => '', diff --git a/drupal/sites/default/boinc/modules/boincuser/boincuser.module b/drupal/sites/default/boinc/modules/boincuser/boincuser.module index bb568eaea7..2935885d8e 100644 --- a/drupal/sites/default/boinc/modules/boincuser/boincuser.module +++ b/drupal/sites/default/boinc/modules/boincuser/boincuser.module @@ -408,6 +408,15 @@ function boincuser_form_alter(&$form, $form_state, $form_id) { break; case 'profile_node_form': + + if (module_exists('captcha')) { + // Add an optional captcha + $form['profile_captcha'] = array( + '#type' => 'captcha', + '#weight' => 999, + ); + } + unset($form['title']); unset($form['body_field']); $form['#redirect'] = 'account/profile';