Captcha integration

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

Moderator: Tata

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

Re: Captcha integration

Post by Tata » Sun Dec 09, 2018 10:14 am

cmb wrote:
Sun Dec 09, 2018 1:47 am
But like I said: I'm not sure if the v2 API is still supported by Google, and if new keys will actually work.
Google offers these keys. On the screenshot it's visible, that the reCaptcha form is there and as I wrote also the evaluation (with and without the images) works. The mail is not sent, however. And the error is reported saying that the code should have been written. It seems to me that the Google reCaptcha is ignored here.
With the Advancedform is the case about the same. There is the built-in reCaptcha function similar to the mailform. Having both plugins installed and configured the Google reCaptcha does not show up.
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.

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Captcha integration

Post by lck » Sun Dec 09, 2018 7:57 pm

Tata wrote:
Sun Dec 09, 2018 10:14 am
With the Advancedform is the case about the same. There is the built-in reCaptcha function similar to the mailform. Having both plugins installed and configured the Google reCaptcha does not show up.
So it works for me with the master version of bbfriend and Advancedform_XH 1.1. Do you test online or locally under Xampp? Under Xampp I don't see the reCaptcha either.

Advancedform_XH configuration:

Code: Select all

$plugin_cf['advancedform']['captcha_plugin']="recaptcha";
Recaptcha_XH configuration: the two keys entered for reCAPTCHA, Version 2

To make the plugin configuration of Recaptcha_XH visible and to delete the XH-DEPRECATED warnings, you have to change the following in admin.php:

Code: Select all

// if (!empty($recaptcha)) {
if (XH_wantsPluginAdministration('recaptcha')) {
...
    //initvar('admin');
    //initvar('action');
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Sun Dec 09, 2018 9:46 pm

lck wrote:
Sun Dec 09, 2018 7:57 pm
Under Xampp I don't see the reCaptcha either.
If I remember correctly, you have to register for a specific domain to get the keys. That likely wouldn't work for localhost.
Christoph M. Becker – Plugins for CMSimple_XH

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Captcha integration

Post by lck » Sun Dec 09, 2018 9:54 pm

cmb wrote:
Sun Dec 09, 2018 9:46 pm
If I remember correctly, you have to register for a specific domain to get the keys. That likely wouldn't work for localhost.
Right, that's the problem.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Sun Dec 09, 2018 9:59 pm

lck wrote:
Sun Dec 09, 2018 9:54 pm
cmb wrote:
Sun Dec 09, 2018 9:46 pm
If I remember correctly, you have to register for a specific domain to get the keys. That likely wouldn't work for localhost.
Right, that's the problem.
Then see https://stackoverflow.com/questions/323 ... -localhost.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Sun Dec 09, 2018 10:46 pm

lck wrote:
Sun Dec 09, 2018 7:57 pm
To make the plugin configuration of Recaptcha_XH visible and to delete the XH-DEPRECATED warnings, you have to change the following in admin.php:

Code: Select all

// if (!empty($recaptcha)) {
if (XH_wantsPluginAdministration('recaptcha')) {
...
    //initvar('admin');
    //initvar('action');
Thanks for the report, Ludwig! I've long given up on this plugin, though, and just archived the repo. Perhaps utaka will update his fork. Otherwise maybe someone else wants to take maintainership? In the worst case, and if really necessary, we could add it to https://github.com/cmsimple-xh.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: Captcha integration

Post by Tata » Mon Dec 10, 2018 6:36 am

lck wrote:
Sun Dec 09, 2018 9:54 pm
cmb wrote:
Sun Dec 09, 2018 9:46 pm
If I remember correctly, you have to register for a specific domain to get the keys. That likely wouldn't work for localhost.
Right, that's the problem.
Actually, I have registered the cmsimple.sk and for testing used the clear172.cmsimple.sk with the same keys. On both domain and its subdomain it works. The only I can't find solution for is the styling of delivered emails. Tested with line ending *nix on/off and mail type text/html. No difference. The only place where the styling is effective is the mailfom. Not its output (sent message).
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.

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Captcha integration

Post by lck » Mon Dec 10, 2018 10:25 am

cmb wrote:
Sun Dec 09, 2018 10:46 pm
Thanks for the report, Ludwig! I've long given up on this plugin, though, and just archived the repo. Perhaps utaka will update his fork.
I also wanted to post it to bbfriend, but you can't write issues there, so I posted it to you with a note about the fork. I thought „Christoph does that already“ :)
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Captcha integration

Post by cmb » Mon Dec 10, 2018 11:20 am

lck wrote:
Mon Dec 10, 2018 10:25 am
I also wanted to post it to bbfriend, but you can't write issues there, so I posted it to you with a note about the fork. I thought „Christoph does that already“ :)
By default Github does not activate the issue tracker for forked repositories, since these are often only used to prepare pull requests. The repo owner has to do this manually.
Christoph M. Becker – Plugins for CMSimple_XH

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Captcha integration

Post by lck » Mon Dec 10, 2018 12:00 pm

Tata wrote:
Mon Dec 10, 2018 6:36 am
The only place where the styling is effective is the mailfom. Not its output (sent message).
Richtig. Hier mal der Quelltext der E-Mail anhand des Beispiel-Formulars "Calc" mit Calc.css im Ordner data/css/

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
div.advfrm-mailform td.label {
    vertical-align: top;
    padding-right: 1em;
    /* the following aligns the labels to the right */
    /*text-align: right;*/
}


.green input {
    background: green;
    color: white;
}

.blue input {
    background: blue;
    color: white;
}

.red input {
    background: red;
    color: white;
}
</style>
</head>
<body>
<div class="advfrm-mailform">
<table>
<tr><td class="label">Number1</td><td class="field">10</td></tr>
<tr><td class="label">Number2</td><td class="field">20</td></tr>
<tr><td class="label">Result</td><td class="field">30</td></tr>
<tr><td class="label">Tries</td><td class="field">2</td></tr>
</table>
</div>
</body>
</html>
Die Styles in Calc.css werden zwar im Header mitgeschickt, aber haben natürlich gar keine Auswirkungen, da die Klassen nur für das Formular gelten und nur dort enthalten sind. Viel zu stylen gibt es da eh nicht, ausser table, tr, td, label und field, es werden ja nur die Daten verschickt. Um das etwas aufzuhübschen könnte man dies in der advancedform/css/stylesheet.css tun oder besser, den Teil wie hier im Beispiel in der Calc.css ergänzen.

Oder Christoph weiß noch eine andere Lösung :?
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

Post Reply