Skip to content

Commit 1c74ddf

Browse files
committed
MC-30537: Test automation with the new 2FA enabled by default
- Static fixes
1 parent a91106f commit 1c74ddf

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

TwoFactorAuth/Controller/Adminhtml/AbstractAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Abstraction for 2FA controllers
15+
*
16+
* @SuppressWarnings(PHPMD.NumberOfChildren)
1517
*/
1618
abstract class AbstractAction extends Action
1719
{

TwoFactorAuth/Model/EmailUserNotifier.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88

99
namespace Magento\TwoFactorAuth\Model;
1010

11-
use Magento\Framework\App\Area;
1211
use Magento\Framework\App\Config\ScopeConfigInterface;
13-
use Magento\Framework\App\State;
14-
use Magento\Framework\UrlInterface;
1512
use Magento\Store\Model\StoreManagerInterface;
1613
use Magento\TwoFactorAuth\Model\Config\UserNotifier as UserNotifierConfig;
1714
use Magento\User\Model\User;
@@ -55,22 +52,19 @@ class EmailUserNotifier implements UserNotifierInterface
5552
* @param TransportBuilder $transportBuilder
5653
* @param StoreManagerInterface $storeManager
5754
* @param LoggerInterface $logger
58-
* @param UrlInterface $url
5955
* @param UserNotifierConfig $userNotifierConfig
6056
*/
6157
public function __construct(
6258
ScopeConfigInterface $scopeConfig,
6359
TransportBuilder $transportBuilder,
6460
StoreManagerInterface $storeManager,
6561
LoggerInterface $logger,
66-
UrlInterface $url,
6762
UserNotifierConfig $userNotifierConfig
6863
) {
6964
$this->scopeConfig = $scopeConfig;
7065
$this->transportBuilder = $transportBuilder;
7166
$this->storeManager = $storeManager;
7267
$this->logger = $logger;
73-
$this->url = $url;
7468
$this->userNotifierConfig = $userNotifierConfig;
7569
}
7670

TwoFactorAuth/view/adminhtml/templates/tfa/configure.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ $list = $block->getProvidersList();
2222
)); ?>
2323
</p>
2424
<?php else: ?>
25-
<form class="tfa-configure-providers" method="post" action="<?= $block->getActionUrl() ?>">
25+
<form class="tfa-configure-providers" method="post" action="<?= $block->escapeHtmlAttr($block->getActionUrl()) ?>">
2626
<ul class="tfa-provider_list">
2727
<?php foreach ($list as $providerData): ?>
2828
<li class="tfa-provider">
2929
<input type="checkbox"
30-
name="tfa_selected[<?= /* @noEscape*/ $block->escapeHtmlAttr($providerData['code']) ?>]"
30+
name="tfa_selected[<?= $block->escapeHtmlAttr($providerData['code']) ?>]"
3131
class="tfa-checkbox"
3232
id="2fa_checkbox-<?= $block->escapeHtmlAttr($providerData['code']) ?>"/>
3333
<label for="2fa_checkbox-<?= $block->escapeHtmlAttr($providerData['code']) ?>">

0 commit comments

Comments
 (0)