Skip to content

Commit 8be4c90

Browse files
committed
LAC-27: Log admin actions with Login as Customer.
1 parent b179a93 commit 8be4c90

26 files changed

+884
-313
lines changed
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\LoginAsCustomerLog\Api\Data;
9+
10+
use Magento\Framework\Api\ExtensibleDataInterface;
11+
12+
/**
13+
* Data interface for login as customer log.
14+
*/
15+
interface LogInterface extends ExtensibleDataInterface
16+
{
17+
const LOG_ID = 'log_id';
18+
const TIME = 'time';
19+
const ACTION_GROUP = 'action_group';
20+
const ACTION = 'action';
21+
const FULL_ACTION_NAME = 'full_action_name';
22+
const RESULT = 'result';
23+
const DETAILS = 'details';
24+
const ERROR = 'error';
25+
const IP_ADDRESS = 'ip_address';
26+
const USERNAME = 'username';
27+
const CUSTOMER_ID = 'customer_id';
28+
29+
/**
30+
* Set login as customer log id.
31+
*
32+
* @param int $logId
33+
* @return void
34+
*/
35+
public function setLogId(int $logId): void;
36+
37+
/**
38+
* Retrieve login as customer log id.
39+
*
40+
* @return null|int
41+
*/
42+
public function getLogId(): ?int;
43+
44+
/**
45+
* Set login as customer log time.
46+
*
47+
* @param string $name
48+
* @return void
49+
*/
50+
public function setTime(string $name): void;
51+
52+
/**
53+
* Retrieve login as customer log time.
54+
*
55+
* @return null|string
56+
*/
57+
public function getTime(): ?string;
58+
59+
/**
60+
* Set login as customer log action group.
61+
*
62+
* @param string $actionGroup
63+
* @return void
64+
*/
65+
public function setActionGroup(string $actionGroup): void;
66+
67+
/**
68+
* Retrieve login as customer log action group.
69+
*
70+
* @return null|string
71+
*/
72+
public function getActionGroup(): ?string;
73+
74+
/**
75+
* Set login as customer log action.
76+
*
77+
* @param string $action
78+
* @return void
79+
*/
80+
public function setAction(string $action): void;
81+
82+
/**
83+
* Retrieve login as customer log action.
84+
*
85+
* @return null|string
86+
*/
87+
public function getAction(): ?string;
88+
89+
/**
90+
* Set login as customer log full action name.
91+
*
92+
* @param string $fullActionName
93+
* @return void
94+
*/
95+
public function setFullActionName(string $fullActionName): void;
96+
97+
/**
98+
* Retrieve login as customer log full action name.
99+
*
100+
* @return null|string
101+
*/
102+
public function getFullActionName(): ?string;
103+
104+
/**
105+
* Set login as customer log result.
106+
*
107+
* @param int $result
108+
* @return void
109+
*/
110+
public function setResult(int $result): void;
111+
112+
/**
113+
* Retrieve login as customer log result.
114+
*
115+
* @return null|int
116+
*/
117+
public function getResult(): ?int;
118+
119+
/**
120+
* Set login as customer log details.
121+
*
122+
* @param string $details
123+
* @return void
124+
*/
125+
public function setDetails(string $details): void;
126+
127+
/**
128+
* Retrieve login as customer log details.
129+
*
130+
* @return null|string
131+
*/
132+
public function getDetails(): ?string;
133+
134+
/**
135+
* Set login as customer log error.
136+
*
137+
* @param string $error
138+
* @return void
139+
*/
140+
public function setError(string $error): void;
141+
142+
/**
143+
* Retrieve login as customer log error.
144+
*
145+
* @return string|null
146+
*/
147+
public function getError(): ?string;
148+
149+
/**
150+
* Set login as customer log ip address.
151+
*
152+
* @param int $ipAddress
153+
* @return void
154+
*/
155+
public function setIpAddress(int $ipAddress): void;
156+
157+
/**
158+
* Retrieve login as customer log ip address.
159+
*
160+
* @return null|int
161+
*/
162+
public function getIpAddress(): ?int;
163+
164+
/**
165+
* Set login as customer log user name.
166+
*
167+
* @param string $username
168+
* @return void
169+
*/
170+
public function setUsername(string $username): void;
171+
172+
/**
173+
* Retrieve login as customer log user name.
174+
*
175+
* @return null|string
176+
*/
177+
public function getUsername(): ?string;
178+
179+
/**
180+
* Set login as customer log customer id.
181+
*
182+
* @param int $customerId
183+
* @return void
184+
*/
185+
public function setCustomerId(int $customerId): void;
186+
187+
/**
188+
* Retrieve login as customer log customer id.
189+
*
190+
* @return null|int
191+
*/
192+
public function getCustomerId(): ?int;
193+
194+
/**
195+
* Set log extension attributes.
196+
*
197+
* @param \Magento\LoginAsCustomerLog\Api\Data\LogExtensionInterface $extensionAttributes
198+
* @return void
199+
*/
200+
public function setExtensionAttributes(LogExtensionInterface $extensionAttributes): void;
201+
202+
/**
203+
* Retrieve log extension attributes.
204+
*
205+
* @return \Magento\LoginAsCustomerLog\Api\Data\LogExtensionInterface
206+
*/
207+
public function getExtensionAttributes(): LogExtensionInterface;
208+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\LoginAsCustomerLog\Api\Data;
9+
10+
use \Magento\Framework\Api\SearchResultsInterface;
11+
12+
interface LogSearchResultsInterface extends SearchResultsInterface
13+
{
14+
/**
15+
* Get sources list
16+
*
17+
* @return \Magento\LoginAsCustomerLog\Api\Data\LogInterface[]
18+
*/
19+
public function getItems();
20+
21+
/**
22+
* Set sources list
23+
*
24+
* @param \Magento\LoginAsCustomerLog\Api\Data\LogInterface[] $items
25+
* @return void
26+
*/
27+
public function setItems(array $items);
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\LoginAsCustomerLog\Api;
9+
10+
use Magento\Framework\Api\SearchCriteriaInterface;
11+
use Magento\LoginAsCustomerLog\Api\Data\LogSearchResultsInterface;
12+
13+
/**
14+
* @todo: add description.
15+
*/
16+
interface GetLogsListInterface
17+
{
18+
/**
19+
* @param SearchCriteriaInterface $searchCriteria
20+
* @return LogSearchResultsInterface
21+
*/
22+
public function execute(SearchCriteriaInterface $searchCriteria): LogSearchResultsInterface;
23+
}

app/code/Magento/LoginAsCustomerLog/Block/Adminhtml/Login.php

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\LoginAsCustomerLog\Controller\Adminhtml\Log;
9+
10+
use Magento\Backend\App\Action;
11+
use Magento\Framework\App\Action\HttpGetActionInterface;
12+
use Magento\Framework\Controller\ResultFactory;
13+
use Magento\Framework\Controller\ResultInterface;
14+
15+
/**
16+
* Login As Customer log grid controller.
17+
*/
18+
class Index extends Action implements HttpGetActionInterface
19+
{
20+
const ADMIN_RESOURCE = 'Magento_LoginAsCustomer::login_log';
21+
22+
/**
23+
* @inheritdoc
24+
*/
25+
public function execute(): ResultInterface
26+
{
27+
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
28+
$resultPage->setActiveMenu('Magento_LoginAsCustomerLog::login_log')
29+
->addBreadcrumb(__('Login as Customer Log'), __('List'));
30+
$resultPage->getConfig()->getTitle()->prepend(__('Login as Customer Log'));
31+
32+
return $resultPage;
33+
}
34+
}

app/code/Magento/LoginAsCustomerLog/Controller/Adminhtml/Login/Grid.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)