scopeConfig = $scopeConfig; $this->scope = $scope; } /** * {@inheritDoc} * * @return string */ public function getCustomerServiceEmail() { return $this->scopeConfig->getValue( self::XML_PATH_EMAIL_RECIPIENT, StoreScopeInterface::SCOPE_STORE ); } /** * {@inheritDoc} * * @return int */ public function getLimitationTimePeriod() { return self::LIMITATION_TIME_PERIOD; } /** * {@inheritDoc} * * @return bool */ public function isAdminAccountSharingEnabled() { return $this->scopeConfig->isSetFlag( self::XML_PATH_ADMIN_ACCOUNT_SHARING, StoreScopeInterface::SCOPE_STORE ); } /** * {@inheritDoc} * * @return int */ public function getAdminSessionLifetime() { return (int) $this->scopeConfig->getValue(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME); } /** * {@inheritDoc} * * @return string */ protected function getXmlPathPrefix() { if ($this->scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_ADMINHTML) { return self::XML_PATH_ADMIN_AREA; } return self::XML_PATH_FRONTEND_AREA; } /** * {@inheritdoc} * * @return int */ public function getPasswordResetProtectionType() { return (int) $this->scopeConfig->getValue( $this->getXmlPathPrefix() . self::XML_PATH_PASSWORD_RESET_PROTECTION_TYPE, StoreScopeInterface::SCOPE_STORE ); } /** * {@inheritDoc} * * @param int $scope * @return int */ public function getMaxNumberPasswordResetRequests() { return (int) $this->scopeConfig->getValue( $this->getXmlPathPrefix() . self::XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS, StoreScopeInterface::SCOPE_STORE ); } /** * {@inheritDoc} * * @param int $scope * @return int */ public function getMinTimeBetweenPasswordResetRequests() { $timeInMin = $this->scopeConfig->getValue( $this->getXmlPathPrefix() . self::XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS, StoreScopeInterface::SCOPE_STORE ); return $timeInMin * 60; } }