emaresh456 Posted November 20, 2017 Report Share Posted November 20, 2017 (edited) I try to fine some forum post on the forum site but no of them are what i need I need to see how i can remove or fix the recaptcha can some one help https://prntscr.com/hcos8u Edited November 20, 2017 by emaresh456 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 20, 2017 Report Share Posted November 20, 2017 (edited) Did you register your domain yet? Register your domain here - https://www.google.com/recaptcha/intro/ Than add the below code to your core/local.config.php. Replace PUT KEY HERE with your keys. /* Keys for recaptcha, you can change these if you want to your own but it's a global key so it should just work */ Config::Set('RECAPTCHA_PUBLIC_KEY', 'PUT KEY HERE'); Config::Set('RECAPTCHA_PRIVATE_KEY', 'PUT KEY HERE'); Edited November 20, 2017 by flyalaska Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 20, 2017 Author Report Share Posted November 20, 2017 i post a pic you will see what i am having, it is saying ERROR for site owner:Invalid domain for site key Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 20, 2017 Author Report Share Posted November 20, 2017 thanks that works 1 Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 21, 2017 Author Report Share Posted November 21, 2017 lol know i have a onther problem the recaptcha works but know i am geting this error Fatal error: Class 'ReCaptcha' not found in /home4/emaresh1982/public_html/core/modules/Registration/Registration.php on line 177 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 21, 2017 Report Share Posted November 21, 2017 Whats your URL? Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 22, 2017 Author Report Share Posted November 22, 2017 it is http://americanflyboys.org Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 22, 2017 Report Share Posted November 22, 2017 what phpVMS version are you using? It will show you in the admin footer Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 23, 2017 Author Report Share Posted November 23, 2017 i am using Version 5.5.2 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 23, 2017 Report Share Posted November 23, 2017 Can you paste the contents of your core/modules/Registration/Registration.php here? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 23, 2017 Moderators Report Share Posted November 23, 2017 I can see that it is working now. Did you manage to resolve it? Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 23, 2017 Author Report Share Posted November 23, 2017 10 hours ago, flyalaska said: Can you paste the contents of your core/modules/Registration/Registration.php here? here it is <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class Registration extends CodonModule { public function HTMLHead() { /*Show our password strength checker */ if($this->get->page == 'register') { $this->renderTemplate('registration_javascript.tpl'); } } public function index() { //updated to Google noCaptcha 1/15 require_once CORE_LIB_PATH.'/recaptcha/recaptchalib.php'; if(Auth::LoggedIn()) { // Make sure they don't over-ride it $this->render('login_already.tpl'); return; } if(isset($_POST['submit'])) { $this->ProcessRegistration(); } else { $this->ShowForm(); } } protected function ShowForm() { //Google reCaptcha //updated to Google noCaptcha 1/15 $this->set('sitekey', RECAPTCHA_PUBLIC_KEY); $this->set('lang', 'en'); $field_list = RegistrationData::GetCustomFields(); $this->set('extrafields', $field_list); $this->set('field_list', $field_list); $airline_list = OperationsData::getAllAirlines(true); $this->set('allairlines', $airline_list); $this->set('airline_list', $airline_list); $hub_list = OperationsData::getAllHubs(); $this->set('allhubs', $hub_list); $this->set('hub_list', $hub_list); $country_list = Countries::getAllCountries(); $this->set('countries', $country_list); $this->set('country_list', $country_list); $this->render('registration_mainform.tpl'); } /** * Registration::ProcessRegistration() * * @return */ protected function ProcessRegistration() { // Yes, there was an error if(!$this->VerifyData()) { $this->ShowForm(); return; } $data = array( 'firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'password' => $this->post->password1, 'code' => $this->post->code, 'location' => $this->post->location, 'hub' => $this->post->hub, 'confirm' => false ); if(CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) { return false; } $ret = RegistrationData::CheckUserEmail($data['email']); if($ret) { $this->set('error', Lang::gs('email.inuse')); $this->render('registration_error.tpl'); return false; } $val = RegistrationData::AddUser($data); if($val == false) { $this->set('error', RegistrationData::$error); $this->render('registration_error.tpl'); return; } else { $pilotid = RegistrationData::$pilotid; /* Automatically confirm them if that option is set */ if(Config::Get('PILOT_AUTO_CONFIRM') == true) { PilotData::AcceptPilot($pilotid); RanksData::CalculatePilotRanks(); $pilot = PilotData::getPilotData($pilotid); $this->set('pilot', $pilot); $this->render('registration_autoconfirm.tpl'); } else { /* Otherwise, wait until an admin confirms the registration */ RegistrationData::SendEmailConfirm($email, $firstname, $lastname); $this->render('registration_sentconfirmation.tpl'); } } CodonEvent::Dispatch('registration_complete', 'Registration', $_POST); // Registration email/show user is waiting for confirmation $sub = 'A user has registered'; $message = "The user {$data['firstname']} {$data['lastname']} ({$data['email']}) has registered, and is awaiting confirmation."; $email = Config::Get('EMAIL_NEW_REGISTRATION'); if(empty($email)) { $email = ADMIN_EMAIL; } Util::SendEmail($email, $sub, $message); // Send email to user $this->set('firstname', $data['firstname']); $this->set('lastname', $data['lastname']); $this->set('userinfo', $data); $message = Template::Get('email_registered.tpl', true); Util::SendEmail($data['email'], 'Registration at '.SITE_NAME, $message); $rss = new RSSFeed('Latest Pilot Registrations', SITE_URL, 'The latest pilot registrations'); $pilot_list = PilotData::GetLatestPilots(); foreach($pilot_list as $pilot) { $rss->AddItem('Pilot '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . ' ('.$pilot->firstname .' ' . $pilot->lastname.')', SITE_URL.'/admin/index.php?admin=pendingpilots','',''); } $rss->BuildFeed(LIB_PATH.'/rss/latestpilots.rss'); } /* * 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 */ 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', ''); } /* Check the email address */ if(filter_var($this->post->email, FILTER_VALIDATE_EMAIL) == false) { $error = true; $this->set('email_error', true); } else { $this->set('email_error', ''); } /* Check the location */ if($this->post->location == '') { $error = true; $this->set('location_error', true); } else { $this->set('location_error', ''); } // Check password length if(strlen($this->post->password1) <= 5) { $error = true; $this->set('password_error', 'The password is too short!'); } else { $this->set('password_error', ''); } // Check is passwords are the same if($this->post->password1 != $this->post->password2) { $error = true; $this->set('password_error', 'The passwords do not match!'); } else { $this->set('password_error', ''); } //Get customs fields $fields = RegistrationData::getCustomFields(); if(count($fields) > 0) { foreach ($fields as $field) { $value = Vars::POST($field->fieldname); $value1 = DB::escape($value); if ($field->required == 1 && $value1 == '') { $error = true; $this->set('custom_'.$field->fieldname.'_error', true); } else { $this->set('custom_'.$field->fieldname.'_error', ''); } } } if($error == true) { return false; } return true; } } Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 23, 2017 Report Share Posted November 23, 2017 Line 177 is $reCaptcha = new ReCaptcha(RECAPTCHA_PRIVATE_KEY); I assume your Private key is wrong. Did you put the two keys in your local.congig.php file? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 23, 2017 Report Share Posted November 23, 2017 2 hours ago, servetas said: I can see that it is working now. Did you manage to resolve it? It is until you click Register. Quote Link to comment Share on other sites More sharing options...
emaresh456 Posted November 24, 2017 Author Report Share Posted November 24, 2017 11 hours ago, flyalaska said: Line 177 is $reCaptcha = new ReCaptcha(RECAPTCHA_PRIVATE_KEY); I assume your Private key is wrong. Did you put the two keys in your local.congig.php file? I did put in the two right key i got Site key Use this in the HTML code your site serves to users. 6Le1jjkUAAAAALGZk72MkWBYXi3PYaOqYPZ4L4O7 Secret key Use this for communication between your site and Google. Be sure to keep it a secret. 6Le1jjkUAAAAAHhaOUNLKhOwofnXIKIxB7YMRBMx I am just only getting Fatal error: Class 'ReCaptcha' not found in /home4/emaresh1982/public_html/core/modules/Registration/Registration.php on line 177 want to know how can i fix that do i have to go in Registration or in app.config.php? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 24, 2017 Report Share Posted November 24, 2017 (edited) /* Keys for recaptcha, you can change these if you want to your own but it's a global key so it should just work */ Config::Set('RECAPTCHA_PUBLIC_KEY','6Le1jjkUAAAAALGZk72MkWBYXi3PYaOqYPZ4L4O7'); Config::Set('RECAPTCHA_PRIVATE_KEY','6Le1jjkUAAAAAHhaOUNLKhOwofnXIKIxB7YMRBMx'); Put the above code in your core/local.config.php Edited November 24, 2017 by flyalaska Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 26, 2017 Moderators Report Share Posted November 26, 2017 The error states "Class 'ReCaptcha' not found". Which phpVMS version are you using? Can you compare the phpvms_directory/core/lib/recaptcha/recaptchalib.php file with this? https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/lib/recaptcha/recaptchalib.php Are the above stated files the same? Quote Link to comment Share on other sites More sharing options...
Heritage1 Posted December 3, 2017 Report Share Posted December 3, 2017 Below is a script until you figure out whats going on with the Registration process, I HIGHLY recommend you rename your original Registration.php file to Registration.php.default first. Always back it up ! You can make duplicates of course while messing around with it. This Code bypasses the call for the Captcha script completely , I don't recommend it, but at least pilots will be able to register until your problem is solved, hope this helps. Jim class Registration extends CodonModule { public function HTMLHead() { /*Show our password strength checker */ if($this->get->page == 'register') { $this->renderTemplate('registration_javascript.tpl'); } } public function index() { //updated to Google noCaptcha 1/15 if(Auth::LoggedIn()) { // Make sure they don't over-ride it $this->render('login_already.tpl'); return; } if(isset($_POST['submit'])) { $this->ProcessRegistration(); } else { $this->ShowForm(); } } protected function ShowForm() { $field_list = RegistrationData::GetCustomFields(); $this->set('extrafields', $field_list); $this->set('field_list', $field_list); $airline_list = OperationsData::getAllAirlines(true); $this->set('allairlines', $airline_list); $this->set('airline_list', $airline_list); $hub_list = OperationsData::getAllHubs(); $this->set('allhubs', $hub_list); $this->set('hub_list', $hub_list); $country_list = Countries::getAllCountries(); $this->set('countries', $country_list); $this->set('country_list', $country_list); $this->render('registration_mainform.tpl'); } /** * Registration::ProcessRegistration() * * @return */ protected function ProcessRegistration() { // Yes, there was an error if(!$this->VerifyData()) { $this->ShowForm(); return; } $data = array( 'firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'password' => $this->post->password1, 'code' => $this->post->code, 'location' => $this->post->location, 'hub' => $this->post->hub, 'confirm' => false ); if(CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) { return false; } $ret = RegistrationData::CheckUserEmail($data['email']); if($ret) { $this->set('error', Lang::gs('email.inuse')); $this->render('registration_error.tpl'); return false; } $val = RegistrationData::AddUser($data); if($val == false) { $this->set('error', RegistrationData::$error); $this->render('registration_error.tpl'); return; } else { $pilotid = RegistrationData::$pilotid; /* Automatically confirm them if that option is set */ if(Config::Get('PILOT_AUTO_CONFIRM') == true) { PilotData::AcceptPilot($pilotid); RanksData::CalculatePilotRanks(); $pilot = PilotData::getPilotData($pilotid); $this->set('pilot', $pilot); $this->render('registration_autoconfirm.tpl'); } else { /* Otherwise, wait until an admin confirms the registration */ RegistrationData::SendEmailConfirm($email, $firstname, $lastname); $this->render('registration_sentconfirmation.tpl'); } } CodonEvent::Dispatch('registration_complete', 'Registration', $_POST); // Registration email/show user is waiting for confirmation $sub = 'A user has registered'; $message = "The user {$data['firstname']} {$data['lastname']} ({$data['email']}) has registered, and is awaiting confirmation."; $email = Config::Get('EMAIL_NEW_REGISTRATION'); if(empty($email)) { $email = ADMIN_EMAIL; } Util::SendEmail($email, $sub, $message); // Send email to user $this->set('firstname', $data['firstname']); $this->set('lastname', $data['lastname']); $this->set('userinfo', $data); $message = Template::Get('email_registered.tpl', true); Util::SendEmail($data['email'], 'Registration at '.SITE_NAME, $message); $rss = new RSSFeed('Latest Pilot Registrations', SITE_URL, 'The latest pilot registrations'); $pilot_list = PilotData::GetLatestPilots(); foreach($pilot_list as $pilot) { $rss->AddItem('Pilot '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . ' ('.$pilot->firstname .' ' . $pilot->lastname.')', SITE_URL.'/admin/index.php?admin=pendingpilots','',''); } $rss->BuildFeed(LIB_PATH.'/rss/latestpilots.rss'); } /* * 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', ''); } /* Check the email address */ if(filter_var($this->post->email, FILTER_VALIDATE_EMAIL) == false) { $error = true; $this->set('email_error', true); } else { $this->set('email_error', ''); } /* Check the location */ if($this->post->location == '') { $error = true; $this->set('location_error', true); } else { $this->set('location_error', ''); } // Check password length if(strlen($this->post->password1) <= 5) { $error = true; $this->set('password_error', 'The password is too short!'); } else { $this->set('password_error', ''); } // Check is passwords are the same if($this->post->password1 != $this->post->password2) { $error = true; $this->set('password_error', 'The passwords do not match!'); } else { $this->set('password_error', ''); } if($error == true) { return false; } return true; } } Quote Link to comment Share on other sites More sharing options...
jbinner Posted April 15, 2019 Report Share Posted April 15, 2019 I am having this SAME exact issue, had to use the bypass script above. Error we are seeing is this: [15-Apr-2019 21:45:42 UTC] PHP Fatal error: Class 'ReCaptcha\ReCaptcha' not found in /home/midconmgmt/public_html/mca/core/modules/Registration/Registration.php on line 167 I have triple-checked and then copied the entire script from the github site for updating to ver2 of ReCaptha; still get a 500 error unless I use thge bypass above. Any other ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.