Captcha integration

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Captcha integration

Post by Tata » Tue Dec 04, 2018 8:44 pm

Is there any actual version of reCaptcha_XH available?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 12940
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Tue Dec 04, 2018 10:27 pm

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.
Christoph M. Becker –Plugins for CMSimple_XH

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Captcha integration

Post by Tata » Sat Dec 08, 2018 10:02 am

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?
You do not have the required permissions to view the files attached to this post.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

olape
Posts: 675
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Captcha integration

Post by olape » Sat Dec 08, 2018 1:43 pm

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?

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Captcha integration

Post by Tata » Sat Dec 08, 2018 2:24 pm

Just followed this https://support.squarespace.com/hc/en-u ... orm-Blocks
Does it have anything to do with DSGVO?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

olape
Posts: 675
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Captcha integration

Post by olape » Sat Dec 08, 2018 2:53 pm

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.

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Captcha integration

Post by Tata » Sat Dec 08, 2018 3:08 pm

Well, and can Google break DSVGO unauthorize collectiong data?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 12940
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Sat Dec 08, 2018 3:13 pm

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.
Christoph M. Becker –Plugins for CMSimple_XH

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Captcha integration

Post by Tata » Sat Dec 08, 2018 4:48 pm

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.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 12940
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Sun Dec 09, 2018 1:47 am

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.
Christoph M. Becker –Plugins for CMSimple_XH

Post Reply