Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions
Config Class Reference
Inheritance diagram for Config:
ConfigInterface

Public Member Functions

 __construct (ScopeConfigInterface $scopeConfig, ScopeInterface $scope)
 
 getCustomerServiceEmail ()
 
 getLimitationTimePeriod ()
 
 isAdminAccountSharingEnabled ()
 
 getAdminSessionLifetime ()
 
 getPasswordResetProtectionType ()
 
 getMaxNumberPasswordResetRequests ()
 
 getMinTimeBetweenPasswordResetRequests ()
 

Data Fields

const LIMITATION_TIME_PERIOD = 3600
 
const XML_PATH_ADMIN_AREA = 'admin/security/'
 
const XML_PATH_FRONTEND_AREA = 'customer/password/'
 
const XML_PATH_FRONTED_AREA = self::XML_PATH_FRONTEND_AREA
 
const XML_PATH_ADMIN_ACCOUNT_SHARING = 'admin/security/admin_account_sharing'
 
const XML_PATH_PASSWORD_RESET_PROTECTION_TYPE = 'password_reset_protection_type'
 
const XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS = 'max_number_password_reset_requests'
 
const XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS = 'min_time_between_password_reset_requests'
 
const XML_PATH_EMAIL_RECIPIENT = 'contact/email/recipient_email'
 

Protected Member Functions

 getXmlPathPrefix ()
 

Detailed Description

Security config

Definition at line 15 of file Config.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ScopeConfigInterface  $scopeConfig,
ScopeInterface  $scope 
)

SecurityConfig constructor.

Parameters
ScopeConfigInterface$scopeConfig
ScopeInterface$scope

Definition at line 80 of file Config.php.

83  {
84  $this->scopeConfig = $scopeConfig;
85  $this->scope = $scope;
86  }

Member Function Documentation

◆ getAdminSessionLifetime()

getAdminSessionLifetime ( )

Get admin session lifetime

Returns
int
Since
100.1.0

Returns
int

Implements ConfigInterface.

Definition at line 129 of file Config.php.

130  {
131  return (int) $this->scopeConfig->getValue(\Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME);
132  }

◆ getCustomerServiceEmail()

getCustomerServiceEmail ( )

Get customer service email address

Returns
string
Since
100.1.0

Returns
string

Implements ConfigInterface.

Definition at line 93 of file Config.php.

94  {
95  return $this->scopeConfig->getValue(
96  self::XML_PATH_EMAIL_RECIPIENT,
97  StoreScopeInterface::SCOPE_STORE
98  );
99  }

◆ getLimitationTimePeriod()

getLimitationTimePeriod ( )

Get time period limitation of password reset requests

Returns
int
Since
100.1.0

Returns
int

Implements ConfigInterface.

Definition at line 106 of file Config.php.

107  {
109  }

◆ getMaxNumberPasswordResetRequests()

getMaxNumberPasswordResetRequests ( )

Get max number password reset requests per time period

Returns
int
Since
100.1.0

Parameters
int$scope
Returns
int

Implements ConfigInterface.

Definition at line 166 of file Config.php.

167  {
168  return (int) $this->scopeConfig->getValue(
169  $this->getXmlPathPrefix() . self::XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS,
170  StoreScopeInterface::SCOPE_STORE
171  );
172  }

◆ getMinTimeBetweenPasswordResetRequests()

getMinTimeBetweenPasswordResetRequests ( )

Get minimum time between password reset requests

Returns
int
Since
100.1.0

Parameters
int$scope
Returns
int

Implements ConfigInterface.

Definition at line 180 of file Config.php.

181  {
182  $timeInMin = $this->scopeConfig->getValue(
183  $this->getXmlPathPrefix() . self::XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS,
184  StoreScopeInterface::SCOPE_STORE
185  );
186  return $timeInMin * 60;
187  }

◆ getPasswordResetProtectionType()

getPasswordResetProtectionType ( )

{Get password reset protection type

Returns
int
Since
100.1.0
}

Returns
int

Implements ConfigInterface.

Definition at line 152 of file Config.php.

153  {
154  return (int) $this->scopeConfig->getValue(
155  $this->getXmlPathPrefix() . self::XML_PATH_PASSWORD_RESET_PROTECTION_TYPE,
156  StoreScopeInterface::SCOPE_STORE
157  );
158  }

◆ getXmlPathPrefix()

getXmlPathPrefix ( )
protected
Returns
string

Definition at line 139 of file Config.php.

140  {
141  if ($this->scope->getCurrentScope() == \Magento\Framework\App\Area::AREA_ADMINHTML) {
143  }
145  }

◆ isAdminAccountSharingEnabled()

isAdminAccountSharingEnabled ( )

Check if admin account sharing is enabled

Returns
bool
Since
100.1.0

Returns
bool

Implements ConfigInterface.

Definition at line 116 of file Config.php.

117  {
118  return $this->scopeConfig->isSetFlag(
119  self::XML_PATH_ADMIN_ACCOUNT_SHARING,
120  StoreScopeInterface::SCOPE_STORE
121  );
122  }

Field Documentation

◆ LIMITATION_TIME_PERIOD

const LIMITATION_TIME_PERIOD = 3600

Period of time which will be used to limit frequency of password reset requests

Definition at line 20 of file Config.php.

◆ XML_PATH_ADMIN_ACCOUNT_SHARING

const XML_PATH_ADMIN_ACCOUNT_SHARING = 'admin/security/admin_account_sharing'

Configuration path to admin account sharing

Definition at line 42 of file Config.php.

◆ XML_PATH_ADMIN_AREA

const XML_PATH_ADMIN_AREA = 'admin/security/'

Configuration path to admin area

Definition at line 25 of file Config.php.

◆ XML_PATH_EMAIL_RECIPIENT

const XML_PATH_EMAIL_RECIPIENT = 'contact/email/recipient_email'

Recipient email config path

Definition at line 62 of file Config.php.

◆ XML_PATH_FRONTED_AREA

const XML_PATH_FRONTED_AREA = self::XML_PATH_FRONTEND_AREA

Configuration path to fronted area

Deprecated:
See also
\Magento\Security\Model\Config::XML_PATH_FRONTEND_AREA

Definition at line 37 of file Config.php.

◆ XML_PATH_FRONTEND_AREA

const XML_PATH_FRONTEND_AREA = 'customer/password/'

Configuration path to frontend area

Definition at line 30 of file Config.php.

◆ XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS

const XML_PATH_MAX_NUMBER_PASSWORD_RESET_REQUESTS = 'max_number_password_reset_requests'

Configuration key to max number password reset requests

Definition at line 52 of file Config.php.

◆ XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS

const XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS = 'min_time_between_password_reset_requests'

Configuration key to minimum time between password reset requests

Definition at line 57 of file Config.php.

◆ XML_PATH_PASSWORD_RESET_PROTECTION_TYPE

const XML_PATH_PASSWORD_RESET_PROTECTION_TYPE = 'password_reset_protection_type'

Configuration key to limit password reset requests method

Definition at line 47 of file Config.php.


The documentation for this class was generated from the following file: