Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-customer
Controller
Account
Login.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Controller\Account
;
8
9
use
Magento\Framework\App\Action\HttpGetActionInterface
;
10
use
Magento\Customer\Model\Session
;
11
use
Magento\Framework\App\Action\Context
;
12
use
Magento\Framework\App\Action\HttpPostActionInterface
;
13
use
Magento\Framework\View\Result\PageFactory
;
14
use
Magento\Customer\Controller\AbstractAccount
;
15
19
class
Login
extends
AbstractAccount
implements
HttpGetActionInterface
,
HttpPostActionInterface
20
{
24
protected
$session
;
25
29
protected
$resultPageFactory
;
30
36
public
function
__construct
(
37
Context
$context,
38
Session
$customerSession,
39
PageFactory
$resultPageFactory
40
) {
41
$this->session = $customerSession;
42
$this->resultPageFactory =
$resultPageFactory
;
43
parent::__construct($context);
44
}
45
51
public
function
execute
()
52
{
53
if
($this->session->isLoggedIn()) {
55
$resultRedirect = $this->resultRedirectFactory->create();
56
$resultRedirect->setPath(
'*/*/'
);
57
return
$resultRedirect;
58
}
59
61
$resultPage = $this->resultPageFactory->create();
62
$resultPage->setHeader(
'Login-Required'
,
'true'
);
63
return
$resultPage;
64
}
65
}
Magento\Framework\App\Action\HttpGetActionInterface
Definition:
HttpGetActionInterface.php:16
Magento\Customer\Model\Session
Definition:
Storage.php:8
Magento\Customer\Controller\Account\Login\__construct
__construct(Context $context, Session $customerSession, PageFactory $resultPageFactory)
Definition:
Login.php:36
Magento\Customer\Controller\Account\Login\$resultPageFactory
$resultPageFactory
Definition:
Login.php:29
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Framework\View\Result\PageFactory
Definition:
PageFactory.php:19
Magento\Customer\Model\Session
Definition:
Session.php:22
Magento\Customer\Controller\Account\Login
Definition:
Login.php:19
Magento\Framework\App\Action\HttpPostActionInterface
Definition:
HttpPostActionInterface.php:16
Magento\Customer\Controller\Account
Definition:
Confirm.php:7
Magento\Framework\App\Action\Context
Definition:
Context.php:24
Magento\Customer\Controller\Account\Login\$session
$session
Definition:
Login.php:24
Magento\Customer\Controller\AbstractAccount
Definition:
AbstractAccount.php:16