This repository was archived by the owner on Dec 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,6 @@ class Contact extends CodonModule
2020{
2121 public function index ()
2222 {
23- require_once CORE_LIB_PATH .'/recaptcha/recaptchalib.php ' ;
24-
25-
2623 if ($ this ->post ->submit )
2724 {
2825 if (Auth::LoggedIn () == false )
@@ -37,13 +34,11 @@ public function index()
3734 }
3835 }
3936
40- $ resp = recaptcha_check_answer (Config::Get ('RECAPTCHA_PRIVATE_KEY ' ),
41- $ _SERVER ["REMOTE_ADDR " ],
42- $ _POST ["recaptcha_challenge_field " ],
43- $ _POST ["recaptcha_response_field " ]);
37+ $ recaptcha = new \ReCaptcha \ReCaptcha (Config::Get ('RECAPTCHA_PRIVATE_KEY ' ));
38+ $ resp = $ recaptcha ->verify ($ _POST ['g-recaptcha-response ' ], $ _SERVER ['REMOTE_ADDR ' ]);
4439
4540 // Check the captcha thingy
46- if (!$ resp ->is_valid )
41+ if (!$ resp ->isSuccess () )
4742 {
4843 $ this ->set ('captcha_error ' , $ resp ->error );
4944 $ this ->set ('message ' , 'You failed the captcha test! ' );
Original file line number Diff line number Diff line change 5656 <tr >
5757 <td width =" 1%" nowrap ><strong >Captcha</strong ></td >
5858 <td >
59- <?php
60- echo recaptcha_get_html(Config::Get('RECAPTCHA_PUBLIC_KEY'), $captcha_error);
61- ?>
59+ <div class =" g-recaptcha" data-sitekey =" <?php echo Config::Get('RECAPTCHA_PUBLIC_KEY'); ?>" ></div >
60+ <script type =" text/javascript"
61+ src =" https://www.google.com/recaptcha/api.js?hl=en" >
62+ </script >
6263 </td >
6364 </tr >
6465
You can’t perform that action at this time.
0 commit comments