Jump to content

Registration Form


FiveStar001

Recommended Posts

Hi all I wounder if you can help me after doing the registration edit for the new google recapture v2 I try and submit a new register and then it submits then when i go to the admin panel it's not showing any pilots I could really do with a little advice it's doing my head in :? 

Pending Pilots

There are no pilots!

Thanks
FIV001

Link to comment
Share on other sites

  • Administrators

Here's the log file contents mentioned above - 

[29-Oct-2018 10:50:26 UTC] PHP Warning:  Use of undefined constant OBJECT - assumed 'OBJECT' (this will throw an Error in a future version of PHP) in /home/flyinter/pilots.flyinternationaluk.com/core/codon.config.php on line 80
[29-Oct-2018 10:50:26 UTC] PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in /home/flyinter/pilots.flyinternationaluk.com/core/classes/Config.class.php on line 117
[29-Oct-2018 10:50:26 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/flyinter/pilots.flyinternationaluk.com/core/classes/ezdb/ezdb_base.class.php on line 661
[29-Oct-2018 10:51:47 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/flyinter/pilots.flyinternationaluk.com/core/templates/registration_mainform.tpl on line 45
[29-Oct-2018 10:52:34 UTC] PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'No secret provided' in /home/flyinter/pilots.flyinternationaluk.com/core/lib/recaptcha/ReCaptcha/ReCaptcha.php:62
Stack trace:
#0 /home/flyinter/pilots.flyinternationaluk.com/core/modules/Registration/Registration.php(168): ReCaptcha\ReCaptcha->__construct('')
#1 /home/flyinter/pilots.flyinternationaluk.com/core/modules/Registration/Registration.php(66): Registration->VerifyData()
#2 /home/flyinter/pilots.flyinternationaluk.com/core/modules/Registration/Registration.php(43): Registration->ProcessRegistration()
#3 [internal function]: Registration->index()
#4 /home/flyinter/pilots.flyinternationaluk.com/core/classes/MainController.class.php(218): call_user_func_array(Array, Array)
#5 /home/flyinter/pilots.flyinternationaluk.com/index.php(60): MainController::RunAllActions()
#6 {main}
  thrown in /home/flyinter/pilots.flyinternationaluk.com/core/lib/recaptcha/ReCaptcha/ReCaptcha.php on line 62

 

Link to comment
Share on other sites

  • Administrators

Is the phpVMS version 5.5.2? IIRC - It should show the version number in the bottom right corner of the main admin panel page.

Don't know if this is a factor - but have you entered both the private and public reCAPTCHA keys you got from Google into the local.config.php file?

Link to comment
Share on other sites

13 hours ago, ProAvia said:

Is the phpVMS version 5.5.2? IIRC - It should show the version number in the bottom right corner of the main admin panel page.

Don't know if this is a factor - but have you entered both the private and public reCAPTCHA keys you got from Google into the local.config.php file?

Hi again I did that in the local.config but not the Php file as I can recall I will have a look tomorrow if I have time and get back to you.

Thank you for trying to help me out.

Link to comment
Share on other sites

If anyone is using the recaptcha default in the /core/app.config.php file, It doesn't WORK , never has since at least 5 years ago. No OFFENSE, the recaptcha key is in the app.config.php file mate, not the local.config.php file. Google offers Free keys for this, and still is, however I also have the Registration file in the  core/modules/Registration.php, which I created a long time ago, it bypasses the recaptcha key all together. This One file has calls on Lines 168 to line 193  that calls the server for the key. Remark it out, but don't delete it, below are examples of before and after. WARNING! ALWAYS BACKUP YOUR FILES !  Do remember that you are wide open without any protection without it, this will buy you some time until you get it fixed and put in your own recaptcha key. Just also so you know, you have two files you have to enter your recaptcha keys to, one is the app.config.php file and the other is the actual registration form for the site which lives in the /templates folder, its called;

registration_mainform.php  , this also is actually the one that sends the actual form, I have actually entered the recaptcha key in this one file, without changing the app.config.php file, and it still worked, however change both with your new key when you get it, and you will be good to go forever, just don't lose your 2 keys.

First file the core/modules/Registration.php  this is the Original file you have........

/*
	 * Process all the registration data
	 */
	protected function VerifyData()
	{
		$error = false;

                //Google reCaptcha
                //updated to Google noCaptcha 1/15
                $resp = null;
                $reCaptcha = new ReCaptcha(RECAPTCHA_PRIVATE_KEY);
                // Was there a reCAPTCHA response?
                if ($_POST["g-recaptcha-response"]) {
                        $resp = $reCaptcha->verifyResponse(
                        $_SERVER["REMOTE_ADDR"],
                        $_POST["g-recaptcha-response"]
                    );
                }

                //check if reCaptcha response was valid
                if ($resp == null) {
                     $error = true;
                     $this->set('captcha_error', 'reCaptcha Validation Error');
                }
                //end Google reCaptcha

		/* Check the firstname and last name
		 */

This is the second file with the changes I've made, again this bypassess the complete recaptcha system, still remark out the actual /templates/registration_mainform.php file where the recaptcha key lives you can't miss it, its down at the bottom before the submit button script............here.......your changes to make, pay attention to where these live on the lines......

/*
	 * Process all the registration data
	 */
	protected function VerifyData()
	{
		$error = false;



		/* Check the firstname and last name
		 */
		if($this->post->firstname == '') {
			$error = true;
			$this->set('firstname_error', true);
		} else {
		  $this->set('firstname_error', '');

		}

		/* Check the last name
		 */
		if($this->post->lastname == '') {
			$error = true;
			$this->set('lastname_error', true);
		}
		else {
		      $this->set('lastname_error', '');
		}

You will see around lines 168 to 173 that its gone, compare the both with a editor that has line numbers, not note pad ConText Editor is freeware, great for quick edits of scripts. I use Adobe DreamWeaver which is not freeware. Note pad does work, but has no number lines obviously. Let me know if this helps, but make a copy of all original files you will be messing with first so Your Safe and poke me anytime with questions etc........ hope this helps, if your unsure about this, then please get someone to help you, I would really be bummed out if you messed this up. Thanks.

Happy Holidays !!

Jim

  • Sad 1
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...