File tree Expand file tree Collapse file tree 14 files changed +36
-65
lines changed
app/code/Magento/LoginAsCustomer
Block/Adminhtml/Customer/Edit
view/adminhtml/ui_component Expand file tree Collapse file tree 14 files changed +36
-65
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Login extends GenericButton implements ButtonProviderInterface
17
17
/**
18
18
* @var \Magento\Framework\AuthorizationInterface
19
19
*/
20
- protected $ _authorization ;
20
+ private $ _authorization ;
21
21
22
22
/**
23
23
* Constructor
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class Index extends \Magento\Backend\App\Action
19
19
/**
20
20
* @var \Magento\LoginAsCustomer\Model\Login
21
21
*/
22
- protected $ loginModel = null ;
22
+ private $ loginModel = null ;
23
23
24
24
/**
25
25
* Index constructor.
Original file line number Diff line number Diff line change @@ -20,23 +20,23 @@ class Login extends \Magento\Backend\App\Action
20
20
/**
21
21
* @var \Magento\LoginAsCustomer\Model\Login
22
22
*/
23
- protected $ loginModel ;
23
+ private $ loginModel ;
24
24
/**
25
25
* @var \Magento\Backend\Model\Auth\Session
26
26
*/
27
- protected $ authSession = null ;
27
+ private $ authSession = null ;
28
28
/**
29
29
* @var \Magento\Store\Model\StoreManagerInterface
30
30
*/
31
- protected $ storeManager = null ;
31
+ private $ storeManager = null ;
32
32
/**
33
33
* @var \Magento\Framework\Url
34
34
*/
35
- protected $ url = null ;
35
+ private $ url = null ;
36
36
/**
37
37
* @var \Magento\LoginAsCustomer\Model\Config
38
38
*/
39
- protected $ config = null ;
39
+ private $ config = null ;
40
40
41
41
/**
42
42
* Login constructor.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Index extends \Magento\Framework\App\Action\Action
13
13
/**
14
14
* @var \Magento\LoginAsCustomer\Model\Login
15
15
*/
16
- protected $ loginModel = null ;
16
+ private $ loginModel = null ;
17
17
18
18
/**
19
19
* Index constructor.
@@ -57,7 +57,7 @@ public function execute()
57
57
* Init login info
58
58
* @return false || \Magento\LoginAsCustomer\Model\Login
59
59
*/
60
- protected function _initLogin ()
60
+ private function _initLogin ()
61
61
{
62
62
$ secret = $ this ->getRequest ()->getParam ('secret ' );
63
63
if (!$ secret ) {
Original file line number Diff line number Diff line change @@ -25,11 +25,12 @@ class Config
25
25
/**
26
26
* @var ScopeConfigInterface
27
27
*/
28
- protected $ scopeConfig ;
28
+
29
+ private $ scopeConfig ;
29
30
/**
30
31
* @var \Magento\Framework\App\ProductMetadataInterface
31
32
*/
32
- protected $ metadata ;
33
+ private $ metadata ;
33
34
34
35
/**
35
36
* Config constructor.
Original file line number Diff line number Diff line change @@ -37,42 +37,42 @@ class Login extends \Magento\Framework\Model\AbstractModel
37
37
/**
38
38
* @var \Magento\Customer\Model\CustomerFactory
39
39
*/
40
- protected $ _customerFactory ;
40
+ private $ _customerFactory ;
41
41
42
42
/**
43
43
* @var \Magento\Customer\Model\Customer
44
44
*/
45
- protected $ _customer ;
45
+ private $ _customer ;
46
46
47
47
/**
48
48
* @var \Magento\Customer\Model\Session
49
49
*/
50
- protected $ _customerSession ;
50
+ private $ _customerSession ;
51
51
52
52
/**
53
53
* @var \Magento\Checkout\Model\Session
54
54
*/
55
- protected $ _checkoutSession ;
55
+ private $ _checkoutSession ;
56
56
57
57
/**
58
58
* @var \Magento\Framework\Stdlib\DateTime\DateTime
59
59
*/
60
- protected $ _dateTime ;
60
+ private $ _dateTime ;
61
61
62
62
/**
63
63
* @var \Magento\Framework\Math\Random
64
64
*/
65
- protected $ _random ;
65
+ private $ _random ;
66
66
67
67
/**
68
68
* @var \Magento\Checkout\Model\Cart
69
69
*/
70
- protected $ cart ;
70
+ private $ cart ;
71
71
72
72
/**
73
73
* @var \Magento\Framework\App\Config\ScopeConfigInterface
74
74
*/
75
- protected $ scopeConfig ;
75
+ private $ scopeConfig ;
76
76
77
77
/**
78
78
* Initialize dependencies.
@@ -167,7 +167,7 @@ public function deleteNotUsed()
167
167
* Retrieve login datetime point
168
168
* @return [type] [description]
169
169
*/
170
- protected function getDateTimePoint ()
170
+ private function getDateTimePoint ()
171
171
{
172
172
return date ('Y-m-d H:i:s ' , $ this ->_dateTime ->gmtTimestamp () - self ::TIME_FRAME );
173
173
}
Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ class ConfigPlugin
16
16
*
17
17
* @var \Magento\Framework\App\Config\ScopeConfigInterface
18
18
*/
19
- protected $ _scopeConfig ;
19
+ private $ _scopeConfig ;
20
20
21
21
/**
22
22
* @var \Magento\Customer\Model\Session
23
23
*/
24
- protected $ _customerSession ;
24
+ private $ _customerSession ;
25
25
26
26
/**
27
27
* Initialize dependencies.
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ class ToolbarPlugin
20
20
/**
21
21
* @var \Magento\Framework\AuthorizationInterface
22
22
*/
23
- protected $ authorization ;
23
+ private $ authorization ;
24
24
25
25
/**
26
26
* @var \Magento\Framework\UrlInterface
27
27
*/
28
- protected $ urlInterface ;
28
+ private $ urlInterface ;
29
29
30
30
/**
31
31
* ToolbarPlugin constructor.
@@ -83,7 +83,7 @@ public function beforePushButtons(
83
83
*
84
84
* @return bool
85
85
*/
86
- protected function isAllowed ()
86
+ private function isAllowed ()
87
87
{
88
88
return $ this ->authorization ->isAllowed ('Magento_LoginAsCustomer::login_button ' );
89
89
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \UrlInterface ;
13
13
use Magento \Framework \AuthorizationInterface ;
14
14
15
- abstract class AbstractColumn extends \Magento \Ui \Component \Listing \Columns \Column
15
+ class Login extends \Magento \Ui \Component \Listing \Columns \Column
16
16
{
17
17
18
18
/**
19
19
* @var UrlInterface
20
20
*/
21
- protected $ urlBuilder ;
21
+ private $ urlBuilder ;
22
22
23
23
/**
24
24
* @var \Magento\Framework\AuthorizationInterface
25
25
*/
26
- protected $ _authorization ;
27
-
28
- protected $ sourceColumnName ;
26
+ private $ _authorization ;
29
27
30
28
/**
31
29
* @param ContextInterface $context
@@ -59,11 +57,14 @@ public function prepareDataSource(array $dataSource)
59
57
if (isset ($ dataSource ['data ' ]['items ' ])) {
60
58
$ hidden = !$ this ->_authorization ->isAllowed ('Magento_LoginAsCustomer::login_button ' );
61
59
foreach ($ dataSource ['data ' ]['items ' ] as &$ item ) {
62
- if (!empty ($ item [$ this ->sourceColumnName ])) {
60
+
61
+ $ sourceColumnName = !empty ($ item ['customer_id ' ]) ? 'customer_id ' : 'entity_id ' ;
62
+
63
+ if (!empty ($ item [$ sourceColumnName ])) {
63
64
$ item [$ this ->getData ('name ' )]['edit ' ] = [
64
65
'href ' => $ this ->urlBuilder ->getUrl (
65
66
'loginascustomer/login/login ' ,
66
- ['customer_id ' => $ item [$ this -> sourceColumnName ]]
67
+ ['customer_id ' => $ item [$ sourceColumnName ]]
67
68
),
68
69
'label ' => __ ('Login As Customer ' ),
69
70
'hidden ' => $ hidden ,
You can’t perform that action at this time.
0 commit comments