Page 1 of 3

Captcha integration

Posted: Tue Dec 04, 2018 8:44 pm
by Tata
Is there any actual version of reCaptcha_XH available?

Re: Captcha integration

Posted: Tue Dec 04, 2018 10:27 pm
by cmb
Tata wrote:
Tue Dec 04, 2018 8:44 pm
Is there any actual version of reCaptcha_XH available?
There is https://github.com/bbfriend/recaptcha_xh, but that requires the v2 API. Not sure, if that's still supported by Google.

Re: Captcha integration

Posted: Sat Dec 08, 2018 10:02 am
by Tata
Well, it seems the Google keys are accepted. But I miss something witih the code integration.
I added the code into the Mailform.php

Code: Select all

        // captcha
        if (isset($cf['mailform']['captcha'])
            && trim($cf['mailform']['captcha']) == 'true'
        ) {
            $o .= /***
                    '<p>' .  $tx['mailform']['captcha'] . '</p>' . "\n"
                .  '<input type="text" name="cap" class="xh_captcha_input"'
                . ' required="required">'
                . "\n" .  '<span class="xh_captcha_code">' . "\n"
                .  $random . '</span>'
                ***/
                /* google reCaptcha */
                '<div class="g-recaptcha" data-sitekey="6LcpMH8UAAAAAF-9e10N5foL8P1QJ45VgwP7o_Gf"></div>' . "\n";
        }
and in recaptcha_xh config

Code: Select all

$plugin_cf['recaptcha']['key_site']="1234567890QWERTZUIO_Gf";
$plugin_cf['recaptcha']['key_secret']="1234567890QWERTZUIOPASD";
and in tenplate

Code: Select all

<script src='https://www.google.com/recaptcha/api.js'></script>
The result is that the reCaptcha form is there and test works fine too, but after confirming it the message is not sent. The messages are still from the original mailform.php. The original recaptcha is evaluated. What else shall be modified?

Re: Captcha integration

Posted: Sat Dec 08, 2018 1:43 pm
by olape
Tata wrote:
Sat Dec 08, 2018 10:02 am
in tenplate

Code: Select all

<script src='https://www.google.com/recaptcha/api.js'></script>
DSGVO?

Re: Captcha integration

Posted: Sat Dec 08, 2018 2:24 pm
by Tata
Just followed this https://support.squarespace.com/hc/en-u ... orm-Blocks
Does it have anything to do with DSGVO?

Re: Captcha integration

Posted: Sat Dec 08, 2018 2:53 pm
by olape
Tata wrote:
Sat Dec 08, 2018 2:24 pm
Does it have anything to do with DSGVO?
Yes, because in the template a script is loaded from another domain, in this case from Google.
So Google could and probably will also collect user data.
And that from all users, not only from those who actually use the form.

Re: Captcha integration

Posted: Sat Dec 08, 2018 3:08 pm
by Tata
Well, and can Google break DSVGO unauthorize collectiong data?

Re: Captcha integration

Posted: Sat Dec 08, 2018 3:13 pm
by cmb
Tata wrote:
Sat Dec 08, 2018 10:02 am
What else shall be modified?
Recaptcha_XH is a Captcha Plugin, but these are not supported by the built-in mailform. Instead you could use Advancedform_XH, where you can configure Recaptcha_XH in the plugin configuration.

Re: Captcha integration

Posted: Sat Dec 08, 2018 4:48 pm
by Tata
I'll try it. It was just a try to integrate the script and keys.
EDIT:
With advancedform is it really simple and comfortable to create modified mailform. There is a hint in the help file
...This is only a minimal text-based solution, but more comprehensive CAPTCHAs can be used through an additional conforming CAPTCHA plugin...
But I see no way how to use e.g. the recaptcha (where the google keys are saved in the configuration) and how/where to use the api.js.

Re: Captcha integration

Posted: Sun Dec 09, 2018 1:47 am
by cmb
Tata wrote:
Sat Dec 08, 2018 4:48 pm
But I see no way how to use e.g. the recaptcha (where the google keys are saved in the configuration) and how/where to use the api.js.
You have to set the respective plugin configuration options of Advancedform_XH and Recaptcha_XH. That is supposed to suffice.

But like I said: I'm not sure if the v2 API is still supported by Google, and if new keys will actually work. If not, it might be better to update Recaptcha_XH to the v3 API instead of manually intergrating the CAPTCHA. In my opinion, the idea of such pluggable CAPTCHA plugins was good (albeit not the API), but unfortunately it didn't get much traction – there are only a few plugins supporting CAPTCHA plugins, and there are only few CAPTCHA plugins.