-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from nmalevanec/LAC-27(WIP)
[WIP]Log admin actions with Login as Customer.
- Loading branch information
Showing
32 changed files
with
959 additions
and
316 deletions.
There are no files selected for viewing
130 changes: 130 additions & 0 deletions
130
app/code/Magento/LoginAsCustomerLog/Api/Data/LogInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\LoginAsCustomerLog\Api\Data; | ||
|
||
use Magento\Framework\Api\ExtensibleDataInterface; | ||
|
||
/** | ||
* Data interface for login as customer log. | ||
* | ||
* @api | ||
*/ | ||
interface LogInterface extends ExtensibleDataInterface | ||
{ | ||
const LOG_ID = 'log_id'; | ||
const TIME = 'time'; | ||
const CUSTOMER_ID = 'customer_id'; | ||
const CUSTOMER_EMAIL = 'customer_email'; | ||
const USER_ID = 'user_id'; | ||
const USERNAME = 'user_name'; | ||
|
||
/** | ||
* Set login as customer log id. | ||
* | ||
* @param int $logId | ||
* @return void | ||
*/ | ||
public function setLogId(int $logId): void; | ||
|
||
/** | ||
* Retrieve login as customer log id. | ||
* | ||
* @return null|int | ||
*/ | ||
public function getLogId(): ?int; | ||
|
||
/** | ||
* Set login as customer log time. | ||
* | ||
* @param string $time | ||
* @return void | ||
*/ | ||
public function setTime(string $time): void; | ||
|
||
/** | ||
* Retrieve login as customer log time. | ||
* | ||
* @return null|string | ||
*/ | ||
public function getTime(): ?string; | ||
|
||
/** | ||
* Set login as customer log user id. | ||
* | ||
* @param int $userId | ||
* @return void | ||
*/ | ||
public function setUserId(int $userId): void; | ||
|
||
/** | ||
* Retrieve login as customer log user id. | ||
* | ||
* @return null|int | ||
*/ | ||
public function getUserId(): ?int; | ||
|
||
/** | ||
* Set login as customer log user name. | ||
* | ||
* @param string $userName | ||
* @return void | ||
*/ | ||
public function setUserName(string $userName): void; | ||
|
||
/** | ||
* Retrieve login as customer log user name. | ||
* | ||
* @return null|string | ||
*/ | ||
public function getUserName(): ?string; | ||
|
||
/** | ||
* Set login as customer log customer id. | ||
* | ||
* @param int $customerId | ||
* @return void | ||
*/ | ||
public function setCustomerId(int $customerId): void; | ||
|
||
/** | ||
* Retrieve login as customer log customer id. | ||
* | ||
* @return null|int | ||
*/ | ||
public function getCustomerId(): ?int; | ||
|
||
/** | ||
* Set login as customer log customer email. | ||
* | ||
* @param string $customerEmail | ||
* @return void | ||
*/ | ||
public function setCustomerEmail(string $customerEmail): void; | ||
|
||
/** | ||
* Retrieve login as customer log customer email. | ||
* | ||
* @return null|string | ||
*/ | ||
public function getCustomerEmail(): ?string; | ||
|
||
/** | ||
* Set log extension attributes. | ||
* | ||
* @param \Magento\LoginAsCustomerLog\Api\Data\LogExtensionInterface $extensionAttributes | ||
* @return void | ||
*/ | ||
public function setExtensionAttributes(LogExtensionInterface $extensionAttributes): void; | ||
|
||
/** | ||
* Retrieve log extension attributes. | ||
* | ||
* @return \Magento\LoginAsCustomerLog\Api\Data\LogExtensionInterface | ||
*/ | ||
public function getExtensionAttributes(): LogExtensionInterface; | ||
} |
33 changes: 33 additions & 0 deletions
33
app/code/Magento/LoginAsCustomerLog/Api/Data/LogSearchResultsInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\LoginAsCustomerLog\Api\Data; | ||
|
||
use \Magento\Framework\Api\SearchResultsInterface; | ||
|
||
/** | ||
* Login as customer log entity search results interface. | ||
* | ||
* @api | ||
*/ | ||
interface LogSearchResultsInterface extends SearchResultsInterface | ||
{ | ||
/** | ||
* Get log list. | ||
* | ||
* @return \Magento\LoginAsCustomerLog\Api\Data\LogInterface[] | ||
*/ | ||
public function getItems(); | ||
|
||
/** | ||
* Set log list. | ||
* | ||
* @param \Magento\LoginAsCustomerLog\Api\Data\LogInterface[] $items | ||
* @return void | ||
*/ | ||
public function setItems(array $items); | ||
} |
27 changes: 27 additions & 0 deletions
27
app/code/Magento/LoginAsCustomerLog/Api/GetLogsListInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\LoginAsCustomerLog\Api; | ||
|
||
use Magento\Framework\Api\SearchCriteriaInterface; | ||
use Magento\LoginAsCustomerLog\Api\Data\LogSearchResultsInterface; | ||
|
||
/** | ||
* Get login as customer log list considering search criteria. | ||
* | ||
* @api | ||
*/ | ||
interface GetLogsListInterface | ||
{ | ||
/** | ||
* Retrieve list of log entities. | ||
* | ||
* @param SearchCriteriaInterface $searchCriteria | ||
* @return LogSearchResultsInterface | ||
*/ | ||
public function execute(SearchCriteriaInterface $searchCriteria): LogSearchResultsInterface; | ||
} |
24 changes: 24 additions & 0 deletions
24
app/code/Magento/LoginAsCustomerLog/Api/SaveLogsInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\LoginAsCustomerLog\Api; | ||
|
||
/** | ||
* Save login as custom logs entities. | ||
* | ||
* @api | ||
*/ | ||
interface SaveLogsInterface | ||
{ | ||
/** | ||
* Save logs. | ||
* | ||
* @param \Magento\LoginAsCustomerLog\Api\Data\LogInterface[] $logs | ||
* @return void | ||
*/ | ||
public function execute(array $logs): void; | ||
} |
27 changes: 0 additions & 27 deletions
27
app/code/Magento/LoginAsCustomerLog/Block/Adminhtml/Login.php
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
app/code/Magento/LoginAsCustomerLog/Controller/Adminhtml/Log/Index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\LoginAsCustomerLog\Controller\Adminhtml\Log; | ||
|
||
use Magento\Backend\App\Action; | ||
use Magento\Framework\App\Action\HttpGetActionInterface; | ||
use Magento\Framework\Controller\ResultFactory; | ||
use Magento\Framework\Controller\ResultInterface; | ||
|
||
/** | ||
* Login As Customer log grid controller. | ||
*/ | ||
class Index extends Action implements HttpGetActionInterface | ||
{ | ||
const ADMIN_RESOURCE = 'Magento_LoginAsCustomerLog::login_log'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function execute(): ResultInterface | ||
{ | ||
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE); | ||
$resultPage->setActiveMenu('Magento_LoginAsCustomerLog::login_log') | ||
->addBreadcrumb(__('Login as Customer Log'), __('List')); | ||
$resultPage->getConfig()->getTitle()->prepend(__('Login as Customer Log')); | ||
|
||
return $resultPage; | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
app/code/Magento/LoginAsCustomerLog/Controller/Adminhtml/Login/Grid.php
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
app/code/Magento/LoginAsCustomerLog/Controller/Adminhtml/Login/Index.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.