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
Adminhtml
Locks
Unlock.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Controller\Adminhtml\Locks
;
8
9
use
Magento\Customer\Model\AuthenticationInterface
;
10
use
Magento\Framework\Controller\ResultFactory
;
11
use
Magento\Backend\App\Action
;
12
16
class
Unlock
extends
\Magento\Backend\App\Action
17
{
23
const
ADMIN_RESOURCE
=
'Magento_Customer::manage'
;
24
30
protected
$authentication
;
31
38
public
function
__construct
(
39
Action
\
Context
$context,
40
AuthenticationInterface
$authentication
41
) {
42
parent::__construct($context);
43
$this->authentication =
$authentication
;
44
}
45
51
public
function
execute
()
52
{
53
$customerId
= $this->
getRequest
()->getParam(
'customer_id'
);
54
try
{
55
// unlock customer
56
if
(
$customerId
) {
57
$this->authentication->unlock(
$customerId
);
58
$this->
getMessageManager
()->addSuccess(
__
(
'Customer has been unlocked successfully.'
));
59
}
60
}
catch
(\Exception $e) {
61
$this->messageManager->addError($e->getMessage());
62
}
63
65
$resultRedirect = $this->resultFactory->create(
ResultFactory::TYPE_REDIRECT
);
66
return
$resultRedirect->setPath(
67
'customer/index/edit'
,
68
[
'id'
=>
$customerId
]
69
);
70
}
71
}
Magento\Customer\Controller\Adminhtml\Locks\Unlock\__construct
__construct(Action\Context $context, AuthenticationInterface $authentication)
Definition:
Unlock.php:38
Magento\Customer\Controller\Adminhtml\Locks
Definition:
Unlock.php:7
Magento\Customer\Model\AuthenticationInterface
Definition:
AuthenticationInterface.php:15
Magento\Customer\Controller\Adminhtml\Locks\Unlock\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
Unlock.php:23
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
__
__()
Definition:
__.php:13
Magento\Customer\Controller\Adminhtml\Locks\Unlock\$authentication
$authentication
Definition:
Unlock.php:30
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Backend\App\AbstractAction\getMessageManager
getMessageManager()
Definition:
AbstractAction.php:124
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
$customerId
$customerId
Definition:
quote_with_customer.php:16
Magento\Framework\Controller\ResultFactory\TYPE_REDIRECT
const TYPE_REDIRECT
Definition:
ResultFactory.php:24
Magento\Backend\App\Action\Context
Definition:
Context.php:25
Magento\Customer\Controller\Adminhtml\Locks\Unlock
Definition:
Unlock.php:16
Magento\Backend\App\Action
Definition:
Context.php:6