Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Feed Class Reference
Inheritance diagram for Feed:
Action AbstractAction ActionInterface Index

Public Member Functions

 __construct (\Magento\Framework\App\Action\Context $context, \Magento\Rss\Model\RssManager $rssManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Api\AccountManagementInterface $customerAccountManagement, \Magento\Framework\HTTP\Authentication $httpAuthentication, \Psr\Log\LoggerInterface $logger)
 
- Public Member Functions inherited from Action
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getActionFlag ()
 
- Public Member Functions inherited from AbstractAction
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getRequest ()
 
 getResponse ()
 
- Public Member Functions inherited from ActionInterface
 execute ()
 

Protected Member Functions

 auth ()
 
- Protected Member Functions inherited from Action
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _redirect ($path, $arguments=[])
 

Protected Attributes

 $customerSession
 
 $customerAccountManagement
 
 $httpAuthentication
 
 $logger
 
 $rssManager
 
 $rssFactory
 
 $scopeConfig
 
- Protected Attributes inherited from Action
 $_objectManager
 
 $_sessionNamespace
 
 $_eventManager
 
 $_actionFlag
 
 $_redirect
 
 $_view
 
 $_url
 
 $messageManager
 
- Protected Attributes inherited from AbstractAction
 $_request
 
 $_response
 
 $resultRedirectFactory
 
 $resultFactory
 

Additional Inherited Members

- Data Fields inherited from ActionInterface
const FLAG_NO_DISPATCH = 'no-dispatch'
 
const FLAG_NO_POST_DISPATCH = 'no-postDispatch'
 
const FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'
 
const PARAM_NAME_BASE64_URL = 'r64'
 
const PARAM_NAME_URL_ENCODED = 'uenc'
 

Detailed Description

Class Feed

Definition at line 11 of file Feed.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Action\Context  $context,
\Magento\Rss\Model\RssManager  $rssManager,
\Magento\Framework\App\Config\ScopeConfigInterface  $scopeConfig,
\Magento\Rss\Model\RssFactory  $rssFactory,
\Magento\Customer\Model\Session  $customerSession,
\Magento\Customer\Api\AccountManagementInterface  $customerAccountManagement,
\Magento\Framework\HTTP\Authentication  $httpAuthentication,
\Psr\Log\LoggerInterface  $logger 
)
Parameters
\Magento\Framework\App\Action\Context$context
\Magento\Rss\Model\RssManager$rssManager
\Magento\Framework\App\Config\ScopeConfigInterface$scopeConfig
\Magento\Rss\Model\RssFactory$rssFactory
\Magento\Customer\Model\Session$customerSession
\Magento\Customer\Api\AccountManagementInterface$customerAccountManagement
\Magento\Framework\HTTP\Authentication$httpAuthentication
\Psr\Log\LoggerInterface$logger

Definition at line 58 of file Feed.php.

67  {
68  $this->rssManager = $rssManager;
69  $this->scopeConfig = $scopeConfig;
70  $this->rssFactory = $rssFactory;
71  $this->customerSession = $customerSession;
72  $this->customerAccountManagement = $customerAccountManagement;
73  $this->httpAuthentication = $httpAuthentication;
74  $this->logger = $logger;
75  parent::__construct($context);
76  }

Member Function Documentation

◆ auth()

auth ( )
protected
Returns
bool

Definition at line 81 of file Feed.php.

82  {
83  if (!$this->customerSession->isLoggedIn()) {
84  list($login, $password) = $this->httpAuthentication->getCredentials();
85  try {
86  $customer = $this->customerAccountManagement->authenticate($login, $password);
87  $this->customerSession->setCustomerDataAsLoggedIn($customer);
88  $this->customerSession->regenerateId();
89  } catch (\Exception $e) {
90  $this->logger->critical($e);
91  }
92  }
93 
94  if (!$this->customerSession->isLoggedIn()) {
95  $this->httpAuthentication->setAuthenticationFailed('RSS Feeds');
96  return false;
97  }
98 
99  return true;
100  }
$customer
Definition: customers.php:11

Field Documentation

◆ $customerAccountManagement

$customerAccountManagement
protected

Definition at line 21 of file Feed.php.

◆ $customerSession

$customerSession
protected

Definition at line 16 of file Feed.php.

◆ $httpAuthentication

$httpAuthentication
protected

Definition at line 26 of file Feed.php.

◆ $logger

$logger
protected

Definition at line 31 of file Feed.php.

◆ $rssFactory

$rssFactory
protected

Definition at line 41 of file Feed.php.

◆ $rssManager

$rssManager
protected

Definition at line 36 of file Feed.php.

◆ $scopeConfig

$scopeConfig
protected

Definition at line 46 of file Feed.php.


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