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

Public Member Functions

 __construct (\Magento\Backend\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
 
 execute ()
 
- Public Member Functions inherited from AbstractAction
 __construct (Action\Context $context)
 
 dispatch (\Magento\Framework\App\RequestInterface $request)
 
 _processUrlKeys ()
 
 getUrl ($route='', $params=[])
 
- 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 ()
 

Protected Attributes

 $resultPageFactory
 
- Protected Attributes inherited from AbstractAction
 $_publicActions = []
 
 $_sessionNamespace = self::SESSION_NAMESPACE
 
 $_helper
 
 $_session
 
 $_authorization
 
 $_auth
 
 $_backendUrl
 
 $_localeResolver
 
 $_canUseBaseUrl
 
 $_formKeyValidator
 
- 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 AbstractAction
const FLAG_IS_URLS_CHECKED = 'check_url_settings'
 
const SESSION_NAMESPACE = 'adminhtml'
 
const ADMIN_RESOURCE = 'Magento_Backend::admin'
 
- 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'
 
- Protected Member Functions inherited from Auth
 _isAllowed ()
 
- Protected Member Functions inherited from AbstractAction
 _isAllowed ()
 
 _getSession ()
 
 getMessageManager ()
 
 _addBreadcrumb ($label, $title, $link=null)
 
 _addContent (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addLeft (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addJs (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _isUrlChecked ()
 
 _processLocaleSettings ()
 
 _redirect ($path, $arguments=[])
 
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _validateSecretKey ()
 
- Protected Member Functions inherited from Action
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _redirect ($path, $arguments=[])
 

Detailed Description

@api

Since
100.0.2

Definition at line 16 of file Login.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Backend\App\Action\Context  $context,
\Magento\Framework\View\Result\PageFactory  $resultPageFactory 
)

Constructor

Parameters
\Magento\Backend\App\Action\Context$context
\Magento\Framework\View\Result\PageFactory$resultPageFactory

Definition at line 29 of file Login.php.

32  {
33  $this->resultPageFactory = $resultPageFactory;
34  parent::__construct($context);
35  }

Member Function Documentation

◆ execute()

execute ( )

Administrator login action

Returns
\Magento\Backend\Model\View\Result\Redirect

Implements ActionInterface.

Definition at line 42 of file Login.php.

43  {
44  if ($this->_auth->isLoggedIn()) {
45  if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) {
46  $this->_auth->getAuthStorage()->setIsFirstPageAfterLogin(true);
47  }
48  return $this->getRedirect($this->_backendUrl->getStartupPageUrl());
49  }
50 
51  $requestUrl = $this->getRequest()->getUri();
52  $backendUrl = $this->getUrl('*');
53  // redirect according to rewrite rule
54  if ($requestUrl != $backendUrl) {
55  return $this->getRedirect($backendUrl);
56  }
57  return $this->resultPageFactory->create();
58  }

Field Documentation

◆ $resultPageFactory

$resultPageFactory
protected

Definition at line 21 of file Login.php.


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