This repository was archived by the owner on Dec 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +18
-17
lines changed Expand file tree Collapse file tree 5 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 77phpvms.iml
88core /local.config.php
99* .iml
10+ core /cache /
Original file line number Diff line number Diff line change 222222Config::Set ('VACENTRAL_NEWS_FEED ' , 'http://feeds.feedburner.com/vacentral ' );
223223Config::Set ('GEONAME_API_SERVER ' , 'http://ws.geonames.org ' );
224224
225- /* Keys for recaptcha, you can change these if you want to your own but it's
226- a global key so it should just work */
227- Config::Set ('RECAPTCHA_PUBLIC_KEY ' , '6LcklAsAAAAAAJqmghmMPOACeJrAxW3sJulSboxx ' );
228- Config::Set ('RECAPTCHA_PRIVATE_KEY ' , '6LcklAsAAAAAAMeQy5ZBoDu8JOMTP-UL7ek1GedO ' );
225+ # Add to the end of local.config.php
226+ # You need to get the keys from here: https://www.google.com/recaptcha/admin
227+ # Put the "Site Key" in RECAPTCHA_PUBLIC_KEY
228+ # Put the "Secret Key" in RECAPTCHA_PRIVATE_KEY
229+ Config::Set ('RECAPTCHA_PUBLIC_KEY ' , '' );
230+ Config::Set ('RECAPTCHA_PRIVATE_KEY ' , '' );
229231
230232/* Whether you have the /admin/maintenance.php script added into cron.
231233 If you do, set this to true. This saves many DB calls since phpVMS will
Original file line number Diff line number Diff line change 1616 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
1717 */
1818
19+ require_once CORE_PATH .'/lib/recaptcha/autoload.php ' ;
20+
1921function pre_module_load ()
2022{
2123 if (is_dir (CORE_PATH .'/local.config.php ' ))
@@ -150,4 +152,4 @@ function fileurl($path)
150152function html_url ($ title , $ url )
151153{
152154 return '<a href=" ' .url ($ url ).'" > ' .$ title .'</a> ' ;
153- }
155+ }
Original file line number Diff line number Diff line change @@ -31,8 +31,6 @@ public function HTMLHead()
3131
3232 public function index ()
3333 {
34- require_once CORE_LIB_PATH .'/recaptcha/recaptchalib.php ' ;
35-
3634 if (Auth::LoggedIn ()) // Make sure they don't over-ride it
3735 {
3836 $ this ->render ('login_already.tpl ' );
@@ -167,13 +165,10 @@ protected function ProcessRegistration()
167165 protected function VerifyData ()
168166 {
169167 $ error = false ;
168+ $ recaptcha = new \ReCaptcha \ReCaptcha (Config::Get ('RECAPTCHA_PRIVATE_KEY ' ));
169+ $ resp = $ recaptcha ->verify ($ _POST ['g-recaptcha-response ' ], $ _SERVER ['REMOTE_ADDR ' ]);
170170
171- $ resp = recaptcha_check_answer (Config::Get ('RECAPTCHA_PRIVATE_KEY ' ),
172- $ _SERVER ["REMOTE_ADDR " ],
173- $ _POST ["recaptcha_challenge_field " ],
174- $ _POST ["recaptcha_response_field " ]);
175-
176- if (!$ resp ->is_valid )
171+ if (!$ resp ->isSuccess ())
177172 {
178173 $ error = true ;
179174 $ this ->set ('captcha_error ' , $ resp ->error );
@@ -256,4 +251,4 @@ protected function VerifyData()
256251
257252 return true ;
258253 }
259- }
254+ }
Original file line number Diff line number Diff line change 9090
9191 <dt >reCaptcha</dt >
9292 <dd >
93- <?php
94- echo recaptcha_get_html(Config::Get('RECAPTCHA_PUBLIC_KEY'), $captcha_error);
95- ?>
93+ <div class =" g-recaptcha" data-sitekey =" <?php echo Config::Get('RECAPTCHA_PUBLIC_KEY'); ?>" ></div >
94+ <script type =" text/javascript"
95+ src =" https://www.google.com/recaptcha/api.js?hl=en" >
96+ </script >
9697 </dd >
9798
9899 <dt ></dt >
You can’t perform that action at this time.
0 commit comments