From 8153e976dede2b343612c26ac12bf65a37a8740f Mon Sep 17 00:00:00 2001 From: Alexander Steshuk Date: Tue, 7 Apr 2020 16:48:50 +0300 Subject: [PATCH 1/5] security-package/issues/188: Added Notice message to system.xml. --- .../System/Config/Form/Field/Notice.php | 34 +++++++++++++++++++ ReCaptchaCustomer/etc/adminhtml/system.xml | 4 +++ ReCaptchaUser/etc/adminhtml/system.xml | 8 +++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php diff --git a/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php new file mode 100644 index 00000000..6b21aeb0 --- /dev/null +++ b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php @@ -0,0 +1,34 @@ +' . '' . __('Important:') . ' ' . '' + . ' ' . __('Please note, for reCAPTCHA to be enabled, + the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '' . ''; + + return $this->_decorateRowHtml($element, $html); + } +} diff --git a/ReCaptchaCustomer/etc/adminhtml/system.xml b/ReCaptchaCustomer/etc/adminhtml/system.xml index a9ed7e6d..d68a9045 100644 --- a/ReCaptchaCustomer/etc/adminhtml/system.xml +++ b/ReCaptchaCustomer/etc/adminhtml/system.xml @@ -10,6 +10,10 @@
+ + Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice + diff --git a/ReCaptchaUser/etc/adminhtml/system.xml b/ReCaptchaUser/etc/adminhtml/system.xml index e90f4d4a..88560fff 100644 --- a/ReCaptchaUser/etc/adminhtml/system.xml +++ b/ReCaptchaUser/etc/adminhtml/system.xml @@ -10,13 +10,17 @@
- + Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice + + Magento\ReCaptchaAdminUi\Model\OptionSource\Type - Magento\ReCaptchaAdminUi\Model\OptionSource\Type From 02df8799c58ca64f26d434585b6be497ee4772f5 Mon Sep 17 00:00:00 2001 From: Alexander Steshuk Date: Tue, 7 Apr 2020 17:00:48 +0300 Subject: [PATCH 2/5] security-package/issues/188: Added CSS styles. --- .../Adminhtml/System/Config/Form/Field/Notice.php | 4 ++-- .../view/adminhtml/web/css/source/_module.less | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less diff --git a/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php index 6b21aeb0..477a2919 100644 --- a/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php +++ b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php @@ -25,9 +25,9 @@ class Notice extends Field */ public function render(AbstractElement $element) { - $html = '' . '' . __('Important:') . ' ' . '' + $html = '

' . '' . __('Important:') . ' ' . '' . ' ' . __('Please note, for reCAPTCHA to be enabled, - the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '' . ''; + the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '' . '

'; return $this->_decorateRowHtml($element, $html); } diff --git a/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less new file mode 100644 index 00000000..d783926f --- /dev/null +++ b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less @@ -0,0 +1,11 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +#recaptcha_frontend_type_for, +#recaptcha_backend_type_for +{ + strong { + color: @grid-severity-critical-color; + } +} From 74cc5d9c94a7884cc557a14976fce59d51635366 Mon Sep 17 00:00:00 2001 From: Alexander Steshuk Date: Thu, 9 Apr 2020 13:16:21 +0300 Subject: [PATCH 3/5] Fixed static test. --- .../Block/Adminhtml/System/Config/Form/Field/Notice.php | 4 ++-- ReCaptchaAdminUi/composer.json | 1 + ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php index 477a2919..9a3b6032 100644 --- a/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php +++ b/ReCaptchaAdminUi/Block/Adminhtml/System/Config/Form/Field/Notice.php @@ -25,8 +25,8 @@ class Notice extends Field */ public function render(AbstractElement $element) { - $html = '

' . '' . __('Important:') . ' ' . '' - . ' ' . __('Please note, for reCAPTCHA to be enabled, + $html = '

' . '' . __('Important:') + . ' ' . '' . ' ' . __('Please note, for reCAPTCHA to be enabled, the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '' . '

'; return $this->_decorateRowHtml($element, $html); diff --git a/ReCaptchaAdminUi/composer.json b/ReCaptchaAdminUi/composer.json index 005a9b9a..6bdebd70 100644 --- a/ReCaptchaAdminUi/composer.json +++ b/ReCaptchaAdminUi/composer.json @@ -4,6 +4,7 @@ "require": { "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", + "magento/module-config": "*", "magento/module-re-captcha-ui": "*" }, "type": "magento2-module", diff --git a/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less index d783926f..aea1cb28 100644 --- a/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less +++ b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less @@ -2,9 +2,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -#recaptcha_frontend_type_for, -#recaptcha_backend_type_for -{ +.recaptcha_frontend_type_for_recaptcha_backend_info_heading_notice, +.recaptcha_frontend_type_for_recaptcha_frontend_info_heading_notice { strong { color: @grid-severity-critical-color; } From e5006852438bd52b6167933e0b3c7a6d6bbd66d0 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Thu, 21 May 2020 15:13:10 -0500 Subject: [PATCH 4/5] magento/security-package#188: Need to add notification message that reCAPCTHA type should be configured before enabling it --- ReCaptchaAdminUi/etc/adminhtml/system.xml | 8 ++++++++ ReCaptchaCustomer/etc/adminhtml/system.xml | 4 ---- ReCaptchaUser/etc/adminhtml/system.xml | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ReCaptchaAdminUi/etc/adminhtml/system.xml b/ReCaptchaAdminUi/etc/adminhtml/system.xml index 5666470f..f3cfdea0 100644 --- a/ReCaptchaAdminUi/etc/adminhtml/system.xml +++ b/ReCaptchaAdminUi/etc/adminhtml/system.xml @@ -22,6 +22,10 @@ + + Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice +
@@ -35,6 +39,10 @@ + + Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice +
diff --git a/ReCaptchaCustomer/etc/adminhtml/system.xml b/ReCaptchaCustomer/etc/adminhtml/system.xml index d68a9045..a9ed7e6d 100644 --- a/ReCaptchaCustomer/etc/adminhtml/system.xml +++ b/ReCaptchaCustomer/etc/adminhtml/system.xml @@ -10,10 +10,6 @@
- - Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice - diff --git a/ReCaptchaUser/etc/adminhtml/system.xml b/ReCaptchaUser/etc/adminhtml/system.xml index 88560fff..8bb4d234 100644 --- a/ReCaptchaUser/etc/adminhtml/system.xml +++ b/ReCaptchaUser/etc/adminhtml/system.xml @@ -10,10 +10,6 @@
- - Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice - From 1f582793296dd2a9bdb9a6ed9f35034ce31934f5 Mon Sep 17 00:00:00 2001 From: Alexander Steshuk Date: Fri, 22 May 2020 14:41:42 +0300 Subject: [PATCH 5/5] Update for CSS. --- ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less index aea1cb28..d4623ef1 100644 --- a/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less +++ b/ReCaptchaAdminUi/view/adminhtml/web/css/source/_module.less @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -.recaptcha_frontend_type_for_recaptcha_backend_info_heading_notice, +.recaptcha_backend_type_for_recaptcha_backend_info_heading_notice, .recaptcha_frontend_type_for_recaptcha_frontend_info_heading_notice { strong { color: @grid-severity-critical-color;