"}}};xhr.send(new URLSearchParams(formData).toString());form.querySelector(".as-formbuilder-status").innerHTML="";form.querySelector(".as-form-builer-submit").disabled=true}}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".as-form-builder").forEach(function(el){new FormBuilder(el)})});
\ No newline at end of file
diff --git a/language/en-GB/en-GB.astroid.ini b/language/en-GB/en-GB.astroid.ini
index 21c552d9..9118ac2a 100644
--- a/language/en-GB/en-GB.astroid.ini
+++ b/language/en-GB/en-GB.astroid.ini
@@ -1193,6 +1193,7 @@ ASTROID_GOOGLE_SITE_KEY="Site Key"
ASTROID_GOOGLE_SITE_KEY_DESC="Use this site key in the HTML code your site serves to users."
ASTROID_GOOGLE_SECRET_KEY="Secret Key"
ASTROID_GOOGLE_SECRET_KEY_DESC="Use this secret key for communication between your site and reCAPTCHA."
+ASTROID_CAPTCHA_SIZE_LABEL="Size"
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_BADGE_BOTTOMLEFT="Bottom left"
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_BADGE_BOTTOMRIGHT="Bottom right"
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_BADGE_DESC="Positioning of the reCAPTCHA badge."
@@ -1204,8 +1205,11 @@ ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_ERROR_CALLBACK_DESC="(Optional) JavaScript ca
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_ERROR_CALLBACK_LABEL="Error Callback"
ASTROID_GOOGLE_RECAPTCHA_ERROR_EMPTY_SOLUTION="Empty solution not allowed."
ASTROID_GOOGLE_RECAPTCHA_ERROR_NO_IP="For security reasons, you must pass the remote IP address to reCAPTCHA."
+ASTROID_GOOGLE_TURNSTILE_ERROR_NO_IP="For security reasons, you must pass the remote IP address to Turnstile."
ASTROID_GOOGLE_RECAPTCHA_ERROR_NO_PRIVATE_KEY="reCAPTCHA plugin needs a secret key to be set in its parameters. Please contact a site administrator."
+ASTROID_GOOGLE_TURNSTILE_ERROR_NO_PRIVATE_KEY="Turnstile Captcha needs a secret key to be set in its parameters. Please contact a site administrator."
ASTROID_GOOGLE_RECAPTCHA_ERROR_NO_PUBLIC_KEY="reCAPTCHA plugin needs a site key to be set in its parameters. Please contact a site administrator."
+ASTROID_GOOGLE_TURNSTILE_ERROR_NO_PUBLIC_KEY="Turnstile Captcha needs a site key to be set in its parameters. Please contact a site administrator."
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_EXPIRED_CALLBACK_DESC="(Optional) JavaScript callback, executed when the reCAPTCHA expired."
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_EXPIRED_CALLBACK_LABEL="Expired Callback"
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_PRIVACY_CAPABILITY_IP_ADDRESS="The Invisible reCAPTCHA plugin integrates with Google's reCAPTCHA system as a spam protection service. As part of this service, the IP address of the user answering the captcha challenge is transmitted to Google."
@@ -1213,6 +1217,7 @@ ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_PRIVATE_KEY_DESC="Used in the communication b
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_PUBLIC_KEY_DESC="Used in the JavaScript code that is served to your users."
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_TABINDEX_DESC="The tabindex of the challenge."
ASTROID_GOOGLE_RECAPTCHA_INVISIBLE_TABINDEX_LABEL="Tabindex"
+ASTROID_TURNSTILE_NOTE="Cloudflare Turnstile"
; Widgets
ASTROID_ELEMENT_CATEGORY_SYSTEM="System"
diff --git a/plugins/astroidcaptcha/astroidcaptcha.xml b/plugins/astroidcaptcha/astroidcaptcha.xml
index 6c56589d..7984a98a 100644
--- a/plugins/astroidcaptcha/astroidcaptcha.xml
+++ b/plugins/astroidcaptcha/astroidcaptcha.xml
@@ -21,26 +21,22 @@
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/astroidcaptcha/src/Extension/AstroidCaptcha.php b/plugins/astroidcaptcha/src/Extension/AstroidCaptcha.php
index ab12e461..fc97ca26 100644
--- a/plugins/astroidcaptcha/src/Extension/AstroidCaptcha.php
+++ b/plugins/astroidcaptcha/src/Extension/AstroidCaptcha.php
@@ -29,11 +29,11 @@ public function onInit($id = null)
{
$app = $this->getApplication();
$captcha_type = $this->params->get('captcha_type', 'default');
- if ($captcha_type == 'recaptcha' || $captcha_type == 'recaptcha_invisible') {
+ if ($captcha_type == 'recaptcha') {
if ($this->params->get('g_site_key', '') === '') {
throw new \RuntimeException($app->getLanguage()->_('ASTROID_GOOGLE_RECAPTCHA_ERROR_NO_PUBLIC_KEY'));
}
- if ($captcha_type == 'recaptcha_invisible') {
+ if ($this->params->get('g_size', 'normal') == 'invisible') {
$onload = ['url' => 'astroid/recaptcha_invisible.min.js', 'function' => 'AstroidinitReCaptchaInvisible'];
$render = 'explicit';
} else {
@@ -41,23 +41,29 @@ public function onInit($id = null)
$render = '';
}
Framework::getDocument()->loadGoogleReCaptcha($onload, $render);
+ } else if ($captcha_type == 'turnstile') {
+ if ($this->params->get('t_site_key', '') === '') {
+ throw new \RuntimeException($app->getLanguage()->_('ASTROID_GOOGLE_TURNSTILE_ERROR_NO_PUBLIC_KEY'));
+ }
+ Framework::getDocument()->loadCloudFlareTurnstile();
}
return true;
}
- public function onDisplay($name = null, $id = 'astroid-recaptcha', $class = '')
+ public function onDisplay($name = null, $id = 'astroid-captcha', $class = '')
{
$captcha_type = $this->params->get('captcha_type', 'default');
$html = '