Skip to content

Commit 8153e97

Browse files
committed
security-package/issues/188: Added Notice message to system.xml.
1 parent b209b88 commit 8153e97

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field;
9+
10+
use Magento\Config\Block\System\Config\Form\Field;
11+
use Magento\Framework\Data\Form\Element\AbstractElement;
12+
13+
/**
14+
* Class for Notice
15+
*/
16+
class Notice extends Field
17+
{
18+
19+
/**
20+
* Render text
21+
*
22+
* @param AbstractElement $element
23+
*
24+
* @return string
25+
*/
26+
public function render(AbstractElement $element)
27+
{
28+
$html = '<td colspan="4">' . '<strong>' . __('Important:') . ' ' . '</strong>'
29+
. ' <span>' . __('Please note, for reCAPTCHA to be enabled,
30+
the valid "Google API Website Key" and "Google API Secret Key" fields are required.') . '</span>' . '</td>';
31+
32+
return $this->_decorateRowHtml($element, $html);
33+
}
34+
}

ReCaptchaCustomer/etc/adminhtml/system.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<system>
1111
<section id="recaptcha_frontend">
1212
<group id="type_for">
13+
<field id="recaptcha_frontend_info_heading" translate="label" sortOrder="100" showInDefault="1"
14+
showInWebsite="1" showInStore="0">
15+
<frontend_model>Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice</frontend_model>
16+
</field>
1317
<field id="customer_login" translate="label" type="select" sortOrder="110" showInDefault="1"
1418
showInWebsite="1" showInStore="0" canRestore="1">
1519
<label>Enable for Customer Login</label>

ReCaptchaUser/etc/adminhtml/system.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
<system>
1111
<section id="recaptcha_backend">
1212
<group id="type_for">
13-
<field id="user_login" translate="label" type="select" sortOrder="100" showInDefault="1"
13+
<field id="recaptcha_backend_info_heading" translate="label" sortOrder="100" showInDefault="1"
14+
showInWebsite="0" showInStore="0" >
15+
<frontend_model>Magento\ReCaptchaAdminUi\Block\Adminhtml\System\Config\Form\Field\Notice</frontend_model>
16+
</field>
17+
<field id="user_login" translate="label" type="select" sortOrder="110" showInDefault="1"
1418
showInWebsite="0" showInStore="0" canRestore="1">
1519
<label>Enable for Login</label>
1620
<source_model>Magento\ReCaptchaAdminUi\Model\OptionSource\Type</source_model>
1721
</field>
1822

19-
<field id="user_forgot_password" translate="label" type="select" sortOrder="110" showInDefault="1"
23+
<field id="user_forgot_password" translate="label" type="select" sortOrder="120" showInDefault="1"
2024
showInWebsite="0" showInStore="0" canRestore="1">
2125
<label>Enable for Forgot Password</label>
2226
<source_model>Magento\ReCaptchaAdminUi\Model\OptionSource\Type</source_model>

0 commit comments

Comments
 (0)