Jump to content

Recommended Posts

Posted

Hello,

OK, I could sure use a little help with fixing reCaptcha on the registration form "ERROR for site owner: Invalid domain for site key" I went to Google and register my domain and got a new site key. My question is where does the new key go?

 

Thank you,

Kenny

Posted

Thank you for the help!!!!!!!!  reCaptcha  is now working, but after a quick test of the registration form this came up, but the registration form did work.

Quote

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/vintagea/public_html/FSV_phpvms/core/lib/recaptcha/recaptchalib.php on line 93

Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify?secret=6LdYO1kUAAAAAIi6_QmKUh1xjXvcJPnx1f6GG-kI&remoteip=98.208.26.125&v=php_1.0&response=03AJpayVFpRdsIfgIffegUmI2HfaSWHSm2BYN_3yv3J66prS6DFAWz-kkksg1sVM_YxlWLtcUVK2nuRyD9E3YGZn3Td4SxGKQI-Cs3PZ7ITzdd73udNYWNsqvq6ChE6nBShRE0Sqb2sH278PetRzEYPu9I03kvvHh5PBmefjUH1d_0E2E797ykN9Snlhcqz5ePqlEHEgGDfi9_hx6vAmAY5xgXfOkNTf4UzoadC_w2xtI0_1BoPpFY-RdVKzCIbvYOPccozpPQFV8jBjpUrtyV1i1q2UpSwfRGjI7uyfmOcbWRd-C4v8ZEFsDgJ-5mSKziQCs8VVRyjPHQfS4_8gOUrj88kbsa6rVm4DBjJxTNjxV90zcJJaCu8dKZj5-O-OPtWQr0rLENB85Qw69ZH0SKRKzcO4b3DkdspTCo24t-vtL9sNof-5uBiA_mydYegxih3Ax3leyJV-t8DXFRBgq37RGt32YZjNaeWw): failed to open stream: no suitable wrapper could be found in /home/vintagea/public_html/FSV_phpvms/core/lib/recaptcha/recaptchalib.php on line 93

Confirmation Sent

Thanks for registering for FSVintageAIR World Airways Virtual, you will be notified via email of your registration status.

 

  • Administrators
Posted

You will need to contact your host about that error. You can also try in Registration.php, changing:

$recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'));

to

$recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'),  new \ReCaptcha\RequestMethod\CurlPost());

Let me know if that works. If it does, I can change the way the default code is to use that instead.

Posted

I tried changing the $recaptcha = new line, but it just crashes the site.

Here's the phpVMS Versionsimpilot 5.5.2  and Registration.php 

Quote

<?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()
    {
        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()
    {
        
        $this->set('extrafields', RegistrationData::GetCustomFields());
        $this->set('allairlines', OperationsData::GetAllAirlines(true));
        $this->set('allhubs', OperationsData::GetAllHubs());
        $this->set('countries', Countries::getAllCountries());
        
        $this->render('registration_mainform.tpl');
    }
    
    protected function ProcessRegistration()
    {
            
        // Yes, there was an error
        if(!$this->VerifyData())
        {
            $this->ShowForm();
        }
        else
        {
            $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');
                }
                /* Otherwise, wait until an admin confirms the registration */
                else
                {
                    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');
            $allpilots = PilotData::GetLatestPilots();
            
            foreach($allpilots 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;
        $recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'));
        $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
        
        if(!$resp->isSuccess())
        {
            $error = true;
            $this->set('captcha_error', $resp->error);
        }
        else
            $this->set('captcha_error', '');
        
        /* 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', '');
        
        /* Check if they agreed to the statement
        if(!$_POST['agree'])
        {
            $error = true;
            $this->set('agree_error', true);
        }
        else
            $this->set('agree_error', '');
         */
        if($error == true)
        {
            return false;
        }
        
        return true;
    }
}

 

  • Administrators
Posted
1 hour ago, FSVKenny said:

I tried changing the $recaptcha = new line, but it just crashes the site.

Here's the phpVMS Versionsimpilot 5.5.2  and Registration.php 

 

I need to see the error message

  • Administrators
Posted
2 hours ago, flyalaska said:

version 5.5.2 already has recaptcha updated to v2

Ah, I didn't know that. Well this is for whoever is on the older one, then :)

Posted

Just a quick note on the above error message; allow_url_fopen=0

This lives in the Server php.ini file, its about half way down the *.ini file, fopen should equal "1", NOT zero. Be very careful when editing the Server php.ini file, make sure you copy and paste into notepad first and save it so you know where it is. You can always paste the original back into the php.ini file of your Server. This error message is common, especially in the older versions of php, such as 5.3.xx to 5.6.xx. This is Not a big deal, its more annoying then anything else. But You should have the allow_url_fopen "Active" anyway, this will effect other software. PHPVMS needs this to be open, hope this helps you and let me know if you need a hand with this, this Is "Advanced". 

Jim

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...