Changeset 1064740
- Timestamp:
- 01/10/2015 04:31:35 PM (11 years ago)
- File:
-
- 1 edited
-
wp-recaptcha-bp/trunk/recaptcha.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-recaptcha-bp/trunk/recaptcha.php
r1064739 r1064740 67 67 add_action('register_form', array(&$this, 68 68 'show_recaptcha_in_registration')); 69 } 69 add_action('bp_before_registration_submit_buttons', array(&$this, 70 'show_recaptcha_in_registration')); 71 add_action('bp_signup_validate', array(&$this, 72 'check_recaptcha_generic'), 0); 73 } 74 75 add_action('lostpassword_form', array(&$this, 76 'show_recaptcha_in_registration')); 77 add_action('lostpassword_post', array(&$this, 78 'check_recaptcha_generic'), 0); 70 79 71 80 add_action('comment_form', array(&$this, 'show_recaptcha_in_comments')); … … 328 337 } 329 338 return $comment_data; 339 } 340 341 function check_recaptcha_generic() { 342 global $user_ID; 343 if ($this->_reCaptchaLib == null) { 344 $this->_reCaptchaLib = new ReCaptcha($this->options['secret']); 345 } 346 $response = $this->_reCaptchaLib->verifyResponse( 347 $_SERVER['REMOTE_ADDR'], 348 $_POST['g-recaptcha-response']); 349 350 if (!$response->success) { 351 $this->_saved_error = $response->error; 352 $error = __('Please check the CAPTCHA code. It\'s not correct.', 'g-recaptcha'); 353 wp_die("<strong>$error</strong>"); 354 return false; 355 } 356 return true; 330 357 } 331 358
Note: See TracChangeset
for help on using the changeset viewer.