![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-two-factor-auth/Controller/Adminhtml/Tfa/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\TwoFactorAuth\Controller\Adminhtml\Tfa; use Magento\Backend\App\Action\Context; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\TwoFactorAuth\Api\TfaInterface; use Magento\TwoFactorAuth\Controller\Adminhtml\AbstractAction; use Magento\TwoFactorAuth\Model\UserConfig\HtmlAreaTokenVerifier; use Magento\Backend\Model\Auth\Session; /** * Configure 2FA for the application. */ class Configure extends AbstractAction implements HttpGetActionInterface { const ADMIN_RESOURCE = 'Magento_TwoFactorAuth::config'; /** * @var TfaInterface */ private $tfa; /** * @var HtmlAreaTokenVerifier */ private $tokenVerifier; /** * @var Session */ private $session; /** * @param Context $context * @param TfaInterface $tfa * @param HtmlAreaTokenVerifier $tokenVerifier * @param Session $session */ public function __construct( Context $context, TfaInterface $tfa, HtmlAreaTokenVerifier $tokenVerifier, Session $session ) { parent::__construct($context); $this->tfa = $tfa; $this->tokenVerifier = $tokenVerifier; $this->session = $session; } /** * @inheritDoc */ public function execute() { $user = $this->session->getUser(); if (!$this->tfa->getUserProviders((int)$user->getId()) && !$this->tokenVerifier->isConfigTokenProvided()) { return $this->_redirect('tfa/tfa/requestconfig'); } return $this->resultFactory->create(ResultFactory::TYPE_PAGE); } }