/[drupal]/contributions/modules/recaptcha/recaptcha.module
ViewVC logotype

Diff of /contributions/modules/recaptcha/recaptcha.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.13.2.4.2.11.2.10, Mon Aug 10 17:50:02 2009 UTC revision 1.13.2.4.2.11.2.11, Mon Aug 10 18:16:17 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: recaptcha.module,v 1.13.2.4.2.11.2.9 2009/07/28 15:50:18 robloach Exp $ */  /* $Id: recaptcha.module,v 1.13.2.4.2.11.2.10 2009/08/10 17:50:02 robloach Exp $ */
3    
4  /**  /**
5   * @file   * @file
# Line 125  function recaptcha_captcha() { Line 125  function recaptcha_captcha() {
125          $captcha['solution'] = TRUE;          $captcha['solution'] = TRUE;
126          $captcha['captcha_validate'] = 'recaptcha_captcha_validation';          $captcha['captcha_validate'] = 'recaptcha_captcha_validation';
127          $html = recaptcha_get_html($recaptcha_public_key, NULL, $recaptcha_secure_connection);          $html = recaptcha_get_html($recaptcha_public_key, NULL, $recaptcha_secure_connection);
128          $captcha['form'] = array(          $captcha['form']['captcha_response'] = array(
129              '#type' => 'hidden',
130              '#value' => 'reCAPTCHA',
131            );
132            $captcha['form']['captcha_form'] = array(
133            '#type' => 'item',            '#type' => 'item',
134            '#value' => ($recaptcha_form_value ? '<div id="recaptcha_custom_theme_widget">'. $recaptcha_form_value .'</div>' : '') . $html,            '#value' => ($recaptcha_form_value ? '<div id="recaptcha_custom_theme_widget">'. $recaptcha_form_value .'</div>' : '') . $html,
135          );          );
# Line 138  function recaptcha_captcha() { Line 142  function recaptcha_captcha() {
142   * CAPTCHA Callback; Validates the reCAPTCHA code.   * CAPTCHA Callback; Validates the reCAPTCHA code.
143   */   */
144  function recaptcha_captcha_validation($solution = NULL, $response = NULL) {  function recaptcha_captcha_validation($solution = NULL, $response = NULL) {
145    if (isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_response_field'])) {    if ($response == 'reCAPTCHA' && isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_response_field'])) {
146      $resp = recaptcha_check_answer(      $resp = recaptcha_check_answer(
147        variable_get('recaptcha_private_key', ''),        variable_get('recaptcha_private_key', ''),
148        $_SERVER['REMOTE_ADDR'],        $_SERVER['REMOTE_ADDR'],

Legend:
Removed from v.1.13.2.4.2.11.2.10  
changed lines
  Added in v.1.13.2.4.2.11.2.11

  ViewVC Help
Powered by ViewVC 1.1.2