| @@ 26-55 (lines=30) @@ | ||
| 23 | ||
| 24 | use Magento\Framework\App\Config\ScopeConfigInterface; |
|
| 25 | ||
| 26 | class Admin |
|
| 27 | { |
|
| 28 | const IS_ENABLED_PATH = 'two_factor_admin_users/details/enable'; |
|
| 29 | const COMPANY_NAME_PATH = 'two_factor_admin_users/details/company_name'; |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @var ScopeConfigInterface |
|
| 33 | */ |
|
| 34 | private $scopeConfig; |
|
| 35 | ||
| 36 | /** |
|
| 37 | * Admin constructor. |
|
| 38 | * |
|
| 39 | * @param ScopeConfigInterface $scopeConfig |
|
| 40 | */ |
|
| 41 | public function __construct(ScopeConfigInterface $scopeConfig) |
|
| 42 | { |
|
| 43 | $this->scopeConfig = $scopeConfig; |
|
| 44 | } |
|
| 45 | ||
| 46 | public function isTwoFactorEnabled() |
|
| 47 | { |
|
| 48 | return $this->scopeConfig->getValue(self::IS_ENABLED_PATH); |
|
| 49 | } |
|
| 50 | ||
| 51 | public function getCompanyName() |
|
| 52 | { |
|
| 53 | return $this->scopeConfig->getValue(self::COMPANY_NAME_PATH); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| @@ 27-56 (lines=30) @@ | ||
| 24 | use Magento\Framework\App\Config\ScopeConfigInterface; |
|
| 25 | use Magento\Store\Model\ScopeInterface; |
|
| 26 | ||
| 27 | class Customer |
|
| 28 | { |
|
| 29 | const IS_ENABLED_PATH = 'two_factor_customers/details/enable'; |
|
| 30 | const COMPANY_NAME_PATH = 'two_factor_customers/details/company_name'; |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @var ScopeConfigInterface |
|
| 34 | */ |
|
| 35 | private $scopeConfig; |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Admin constructor. |
|
| 39 | * |
|
| 40 | * @param ScopeConfigInterface $scopeConfig |
|
| 41 | */ |
|
| 42 | public function __construct(ScopeConfigInterface $scopeConfig) |
|
| 43 | { |
|
| 44 | $this->scopeConfig = $scopeConfig; |
|
| 45 | } |
|
| 46 | ||
| 47 | public function isTwoFactorEnabled() |
|
| 48 | { |
|
| 49 | return $this->scopeConfig->getValue(self::IS_ENABLED_PATH, ScopeInterface::SCOPE_STORE); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function getCompanyName() |
|
| 53 | { |
|
| 54 | return $this->scopeConfig->getValue(self::COMPANY_NAME_PATH, ScopeInterface::SCOPE_STORE); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||