HCaptcha Support - Question | JoomShaper

HCaptcha Support

J

Jeroen

SP Page Builder 1 year ago

Hi,

I'm looking for hCaptcha (https://www.hcaptcha.com/) support in the forms addon in SP Page Builder Pro 5.2.6. How can this be done?

Best regards, Jeroen

0
8 Answers
J
Jeroen
Accepted Answer
1 year ago #149143

I hope hCaptcha will be added to SPPB5 or that the mentioned data2site hCaptcha plugin is allowed to work with SPPB5.

Best regards, Jeroen

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 year ago #149008

Hi Jeroen,

  1. Right now we don't support it.
  2. Only by Addon code customization (site.php)

OR

Install Form extension that support it.

Yes, I added to wish list.

0
J
Jeroen
Accepted Answer
1 year ago #149012

Hi Paul,

I have installed the plugin https://data2site.com/extensions/hcaptcha in Joomla 4.4.2. Activated the plugin. In the "Global configuration" of Joomla at "Default Captcha" I can now select "CAPTCHA - hCaptcha". In SP Page builder Pro at the "Form Builder" plugin I can only select "Default" which is the standard captcha of SP Page Builder, "Google reCaptcha" and "Google Invisible reCaptcha". Why can't I select hCaptcha from Data2site?

Best regards, Jeroen

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 year ago #149016

Becuase it wasn't included in addon sourcecode.

0
B
bouey
Accepted Answer
1 year ago #149170

Hi,

It's seem not too complicated to add , i have done it on my site (for the form_builder addon) tested on 3.8.10 but should work exacly the same in 5.X

  1. install and publish the plugin from https://data2site.com/extensions/hcaptcha set it as default captcha as hcaptcha in Joomla > Global Configuration Site

  2. make an override of the form_builder in your template templates/{your_template}/sppagebuilder/addons/form_builder

  3. copy the original file site.php and admin.php

  4. modify admin.php to add the choise of hcaptcha

  5. modify site.php to manage the hcaptcha

admin.php line 436 add the line with //sbou and make an override in your language to have the right name

                        'values' => array(
                            'default'   => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_DEFAULT'),
                            'gcaptcha'  => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_GCHAPTCHA'),
                            'igcaptcha' => Text::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_INVISIBLE_GCHAPTCHA'),
                            'hcaptcha' => JText::_('COM_SPPAGEBUILDER_GLOBAL_CAPTCHA_TYPE_HCAPTCHA'),//sbou
                        ),

site.php 2 changes line 312 add the line between //sbou .... //end sbou

        elseif ($enable_captcha && $captcha_type == 'igcaptcha')
        {
            PluginHelper::importPlugin('captcha', 'recaptcha_invisible');
            Factory::getApplication()->triggerEvent('onInit', ['invisible_recaptcha_' . $this->addon->id]);
            $recaptcha = Factory::getApplication()->triggerEvent('onDisplay', array(null, 'invisible_recaptcha_' . $this->addon->id, 'sppb-dynamic-recaptcha'));

            $output .= (isset($recaptcha[0])) ? $recaptcha[0] : '<p class="sppb-text-danger">' . Text::_('COM_SPPAGEBUILDER_ADDON_AJAX_CONTACT_INVISIBLE_CAPTCHA_NOT_INSTALLED') . '</p>';
        }
        //sbou
        elseif ($enable_captcha && $captcha_type == 'hcaptcha')
        {
            PluginHelper::importPlugin('captcha', 'hcaptcha');
            Factory::getApplication()->triggerEvent('onInit');
            $recaptcha = Factory::getApplication()->triggerEvent('onDisplay', array(null, 'hcaptcha_' . $this->addon->id, 'sppb-dynamic-hcaptcha'));

            $output .= (isset($recaptcha[0])) ? $recaptcha[0] : '<p class="sppb-text-danger">' . Text::_('COM_SPPAGEBUILDER_ADDON_AJAX_CONTACT_HCAPTCHA_NOT_INSTALLED') . '</p>';
        }
        //end sbou
        $output .= '<input type="hidden" name="captcha_type" value="' . $captcha_type . '">';

ligne 566

if ($captcha_type == 'igcaptcha')
                    {
                        PluginHelper::importPlugin('captcha', 'recaptcha_invisible');
                        $output['gcaptchaId']   = 'invisible_recaptcha_' . $addon_id;
                        $output['gcaptchaType'] = 'invisible';
                    }
                    elseif ($captcha_type == 'hcaptcha')//sbou
                    {
                        PluginHelper::importPlugin('captcha', 'hcaptcha');
                        $output['gcaptchaId']   = 'hcaptcha_' . $addon_id;
                        $output['gcaptchaType'] = 'dynamic';
                    }
                    else
                    {
                        PluginHelper::importPlugin('captcha', 'recaptcha');
                        $output['gcaptchaId']   = 'dynamic_recaptcha_' . $addon_id;
                        $output['gcaptchaType'] = 'dynamic';
                    }

Stéphane faboba.com

0
J
Jeroen
Accepted Answer
1 year ago #149416

Thanks for your information Bouey. I just prefer to use overrides as little as possible. So I hope Joomshaper will add hCaptcha to SPPB.

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 year ago #149419

Thanks, Yes, I added to wish-list.

@Jeroen - you can just override only that addon inside template folder, and use it as long you need.

0
B
bouey
Accepted Answer
1 year ago #149886

Yes it was write on my thread but Jeroen prefer not to make override

make an override of the form_builder in your template templates/{your_template}/sppagebuilder/addons/form_builder

tested since a week and work fine

Stéphane

0