本文整理汇总了PHP中Magento\Backend\App\ConfigInterface::isSetFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigInterface::isSetFlag方法的具体用法?PHP ConfigInterface::isSetFlag怎么用?PHP ConfigInterface::isSetFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Backend\App\ConfigInterface
的用法示例。
在下文中一共展示了ConfigInterface::isSetFlag方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFeedUrl
/**
* Retrieve feed url
*
* @return string
*/
public function getFeedUrl()
{
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
if (is_null($this->_feedUrl)) {
$this->_feedUrl = $httpPath . $this->_backendConfig->getValue(self::XML_FEED_URL_PATH);
}
return $this->_feedUrl;
}
示例2: authenticate
/**
* Authenticate user name and password and save loaded record
*
* @param string $username
* @param string $password
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function authenticate($username, $password)
{
$config = $this->_config->isSetFlag('admin/security/use_case_sensitive_login');
$result = false;
try {
$this->_eventManager->dispatch(
'admin_user_authenticate_before',
['username' => $username, 'user' => $this]
);
$this->loadByUsername($username);
$sensitive = $config ? $username == $this->getUsername() : true;
if ($sensitive && $this->getId()) {
$result = $this->verifyIdentity($password);
}
$this->_eventManager->dispatch(
'admin_user_authenticate_after',
['username' => $username, 'password' => $password, 'user' => $this, 'result' => $result]
);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->unsetData();
throw $e;
}
if (!$result) {
$this->unsetData();
}
return $result;
}
示例3: getRefreshUrl
/**
* Returns URL to controller action which returns new captcha image
*
* @return string
*/
public function getRefreshUrl()
{
return $this->_url->getUrl('adminhtml/refresh/refresh', ['_secure' => $this->_config->isSetFlag('web/secure/use_in_adminhtml'), '_nosecret' => true]);
}
示例4: isActive
/**
* {@inheritdoc}
*/
public function isActive($scope = null)
{
return $this->config->isSetFlag('dev/translate_inline/active_admin');
}
示例5: shouldBeSecure
/**
* {@inheritdoc}
*
* @param string $path
* @return bool
*/
public function shouldBeSecure($path)
{
return parse_url((string) $this->coreConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, 'default'), PHP_URL_SCHEME) === 'https' || $this->backendConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML) && parse_url((string) $this->coreConfig->getValue(Store::XML_PATH_SECURE_BASE_URL, 'default'), PHP_URL_SCHEME) === 'https';
}
示例6: _shouldBeSecure
/**
* Check whether URL for corresponding path should use https protocol
*
* @param string $path
* @return bool
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _shouldBeSecure($path)
{
return substr((string) $this->_coreConfig->getValue('web/unsecure/base_url', 'default'), 0, 5) === 'https' || $this->_backendConfig->isSetFlag('web/secure/use_in_adminhtml') && substr((string) $this->_coreConfig->getValue('web/secure/base_url', 'default'), 0, 5) === 'https';
}
示例7: authenticate
/**
* Authenticate user name and password and save loaded record
*
* @param string $username
* @param string $password
* @return bool
* @throws \Magento\Framework\Model\Exception
* @throws \Magento\Backend\Model\Auth\Exception
* @throws \Magento\Backend\Model\Auth\Plugin\Exception
*/
public function authenticate($username, $password)
{
$config = $this->_config->isSetFlag('admin/security/use_case_sensitive_login');
$result = false;
try {
$this->_eventManager->dispatch('admin_user_authenticate_before', array('username' => $username, 'user' => $this));
$this->loadByUsername($username);
$sensitive = $config ? $username == $this->getUsername() : true;
if ($sensitive && $this->getId() && $this->_encryptor->validateHash($password, $this->getPassword())) {
if ($this->getIsActive() != '1') {
throw new \Magento\Backend\Model\Auth\Exception(__('This account is inactive.'));
}
if (!$this->hasAssigned2Role($this->getId())) {
throw new \Magento\Backend\Model\Auth\Exception(__('Access denied.'));
}
$result = true;
}
$this->_eventManager->dispatch('admin_user_authenticate_after', array('username' => $username, 'password' => $password, 'user' => $this, 'result' => $result));
} catch (\Magento\Framework\Model\Exception $e) {
$this->unsetData();
throw $e;
}
if (!$result) {
$this->unsetData();
}
return $result;
}