reCaptcha on HTTPS site

Report issues with Enuuk Auction Platform or Mods here - remember to raise a ticket with phpauction.net as well
Post Reply
RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

reCaptcha on HTTPS site

Post by RWAP » Thu Jun 22, 2017 12:07 pm

If you have set up to use HTTPS for your site, then the Google reCaptcha plugin does not display when a user tries to register.

This is easily fixed by a small change to class\Action\User.php.
Find:

Code: Select all

        //Display the captcha code if enabled by admin
        if ($this->context->siteOptions['captcha']) {
            require_once('class/contrib/recaptcha/recaptchalib.php');
            $data['publickey'] = "xxxxxxxxxx";
            $data['privatekey'] = "xxxxxxxxxxxx";
            $data['captcha'] = recaptcha_get_html($data['publickey'], $error);
        }
Change this to:

Code: Select all

        //Display the captcha code if enabled by admin
        if ($this->context->siteOptions['captcha']) {
            $useSSL = false;
            if ($this->context->siteOptions['protocol'] == 'https') $useSSL = true;
            require_once('class/contrib/recaptcha/recaptchalib.php');
            $data['publickey'] = "xxxxxxxxxx";
            $data['privatekey'] = "xxxxxxxxxxxx";
            $data['captcha'] = recaptcha_get_html($data['publickey'], $error, $useSSL);
        }
Remember to change the publickey and privatekey accordingly.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests