diff --git a/components/com_users/forms/registration.xml b/components/com_users/forms/registration.xml index 1b549084cde9b..637be5cb95902 100644 --- a/components/com_users/forms/registration.xml +++ b/components/com_users/forms/registration.xml @@ -73,7 +73,9 @@ validDomains="com_users.domains" autocomplete="email" /> + +
setLayout($active->query['layout']); } + $captchaSet = $this->params->get('captcha', Factory::getApplication()->get('captcha', '0')); + + foreach (PluginHelper::getPlugin('captcha') as $plugin) { + if ($captchaSet === $plugin->name) { + $this->captchaEnabled = true; + break; + } + } + // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx', ''), ENT_COMPAT, 'UTF-8'); diff --git a/components/com_users/tmpl/registration/default.php b/components/com_users/tmpl/registration/default.php index 79fcbd67faa4f..17771b44026c1 100644 --- a/components/com_users/tmpl/registration/default.php +++ b/components/com_users/tmpl/registration/default.php @@ -28,6 +28,9 @@
form->getFieldsets() as $fieldset) : ?> + name === 'captcha' && $this->captchaEnabled) : ?> + + form->getFieldset($fieldset->name); ?>
@@ -39,6 +42,9 @@
+ captchaEnabled) : ?> + form->renderFieldset('captcha'); ?> +