ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
interface ActiveSessionManagerInterface
|
||||
{
|
||||
public function initNew(): void;
|
||||
|
||||
public function update(): void;
|
||||
|
||||
public function terminate(string $sessionId = null): void;
|
||||
|
||||
public function getInactiveSessions(): array;
|
||||
|
||||
public function terminateAll(): void;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface;
|
||||
|
||||
interface ActiveSessionRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getById(int $id): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @param string $sessionId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getBySessionId(string $sessionId): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface $activeSession
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function save(ActiveSessionInterface $activeSession): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface $activeSession
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function delete(ActiveSessionInterface $activeSession): bool;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function deleteById(int $id): bool;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface ActiveSessionInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSessionId(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $sessionId
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setSessionId(string $sessionId): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getAdminSessionInfoId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int|null $adminSessionInfoId
|
||||
* @return ActiveSessionInterface
|
||||
*/
|
||||
public function setAdminSessionInfoId(?int $adminSessionInfoId): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getUserId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int|null $userId
|
||||
* @return ActiveSessionInterface
|
||||
*/
|
||||
public function setUserId(?int $userId): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setUsername(string $username): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFullName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $fullName
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setFullName(string $fullName): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIp(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setIp(string $ip): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSessionStart(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $startTime
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setSessionStart(string $startTime): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRecentActivity(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $activityTime
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setRecentActivity(string $activityTime): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLocation(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $location
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setLocation(string $location): ActiveSessionInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCountryId(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $countryId
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\ActiveSessionInterface
|
||||
*/
|
||||
public function setCountryId(string $countryId): ActiveSessionInterface;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface LogDetailInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLogId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int $logId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setLogId(int $logId): LogDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setName(string $name): LogDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOldValue(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $oldValue
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setOldValue(string $oldValue): LogDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getNewValue(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $newValue
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setNewValue(string $newValue): LogDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getModel(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $model
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface
|
||||
*/
|
||||
public function setModel(string $model): LogDetailInterface;
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface LogEntryInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDate(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $date
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setDate(string $date): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setUsername(string $username): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setType(string $type): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCategory(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $category
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setCategory(string $category): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCategoryName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $categoryName
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setCategoryName(string $categoryName): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getParameterName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $parameterName
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setParameterName(string $parameterName): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getElementId(): int;
|
||||
|
||||
/**
|
||||
* @param int $elementId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setElementId(int $elementId): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getViewElementId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int|null $viewElementId
|
||||
*
|
||||
* @return LogEntryInterface
|
||||
*/
|
||||
public function setViewElementId(?int $viewElementId): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getItem(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $item
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setItem(string $item): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIp(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $ipAddress
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setIp(string $ipAddress): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getStoreId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int $storeId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setStoreId(int $storeId): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAdditionalData();
|
||||
|
||||
/**
|
||||
* @param mixed $additionalData
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setAdditionalData($additionalData): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogDetailInterface[]
|
||||
*/
|
||||
public function getLogDetails(): array;
|
||||
|
||||
/**
|
||||
* @param array $logDetails
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
*/
|
||||
public function setLogDetails(array $logDetails): LogEntryInterface;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
use Magento\Framework\Api\SearchResultsInterface;
|
||||
|
||||
interface LogEntrySearchResultsInterface extends SearchResultsInterface
|
||||
{
|
||||
/**
|
||||
* Get log entries list.
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface[]
|
||||
*/
|
||||
public function getItems();
|
||||
|
||||
/**
|
||||
* Set log entries list.
|
||||
*
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LogEntryInterface[] $items
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems(array $items);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface LoginAttemptInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDate(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $date
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setDate(string $date): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setUsername(string $username): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFullName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $fullName
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setFullName(string $fullName): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIp(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setIp(string $ip): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getStatus(): ?int;
|
||||
|
||||
/**
|
||||
* @param int $status
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setStatus(int $status): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLocation(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $location
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setLocation(string $location): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCountryId(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $countryId
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setCountryId(string $countryId): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserAgent(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $userAgent
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
*/
|
||||
public function setUserAgent(string $userAgent): LoginAttemptInterface;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
use Magento\Framework\Api\SearchResultsInterface;
|
||||
|
||||
interface LoginAttemptSearchResultsInterface extends SearchResultsInterface
|
||||
{
|
||||
/**
|
||||
* Get login attempts list.
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface[]
|
||||
*/
|
||||
public function getItems();
|
||||
|
||||
/**
|
||||
* Set login attempts list.
|
||||
*
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface[] $items
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems(array $items);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface VisitHistoryDetailInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getVisitId(): ?int;
|
||||
|
||||
/**
|
||||
* @param int $visitId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setVisitId(int $visitId): VisitHistoryDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPageName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $pageName
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setPageName(string $pageName): VisitHistoryDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPageUrl(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $pageUrl
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setPageUrl(string $pageUrl): VisitHistoryDetailInterface;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getStayDuration(): ?int;
|
||||
|
||||
/**
|
||||
* @param int $stayDuration
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setStayDuration(int $stayDuration): VisitHistoryDetailInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSessionId(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $sessionId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface
|
||||
*/
|
||||
public function setSessionId(string $sessionId): VisitHistoryDetailInterface;
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface VisitHistoryEntryInterface
|
||||
{
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @param int|null $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setId($id);
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setUsername(string $username): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFullName(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $fullName
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setFullName(string $fullName): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSessionStart(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $sessionStart
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setSessionStart(string $sessionStart): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSessionEnd(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $sessionEnd
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setSessionEnd(string $sessionEnd): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIp(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setIp(string $ip): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLocation(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $location
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setLocation(string $location): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSessionId(): ?string;
|
||||
|
||||
/**
|
||||
* @param string $sessionId
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setSessionId(string $sessionId): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryDetailInterface[]
|
||||
*/
|
||||
public function getVisitHistoryDetails(): array;
|
||||
|
||||
/**
|
||||
* @param array $visitHistoryDetails
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
*/
|
||||
public function setVisitHistoryDetails(array $visitHistoryDetails): VisitHistoryEntryInterface;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Data;
|
||||
|
||||
interface VisitHistoryEntrySearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
|
||||
{
|
||||
/**
|
||||
* Get visit history list.
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface[]
|
||||
*/
|
||||
public function getItems();
|
||||
|
||||
/**
|
||||
* Set visit history list.
|
||||
*
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface[] $items
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems(array $items);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\LogEntryInterface;
|
||||
use Amasty\AdminActionsLog\Api\Data\LogEntrySearchResultsInterface;
|
||||
use Magento\Framework\Api\SearchCriteriaInterface;
|
||||
|
||||
interface LogEntryRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getById(int $id): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LogEntryInterface $logEntry
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntryInterface
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function save(LogEntryInterface $logEntry): LogEntryInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LogEntryInterface $logEntry
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function delete(LogEntryInterface $logEntry): bool;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function deleteById(int $id): bool;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LogEntrySearchResultsInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getList(SearchCriteriaInterface $searchCriteria): LogEntrySearchResultsInterface;
|
||||
|
||||
/**
|
||||
* @param int|null $period
|
||||
*
|
||||
* @return void
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function clean(?int $period = null): void;
|
||||
|
||||
/**
|
||||
* @param array|null $storeIds
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function cleanByStoreIds(?array $storeIds = []): void;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Logging;
|
||||
|
||||
interface EntitySaveHandlerInterface
|
||||
{
|
||||
/**
|
||||
* Method returns specific LogEntry's data after object saving/deleting.
|
||||
* @see \Amasty\AdminActionsLog\Logging\ActionType\AfterSave\Entity::prepareLogEntryData
|
||||
*
|
||||
* @param MetadataInterface $metadata
|
||||
* @return array
|
||||
*/
|
||||
public function getLogMetadata(MetadataInterface $metadata): array;
|
||||
|
||||
/**
|
||||
* Method for extracting and generating key => value array with data from concrete object
|
||||
* for LogDetail entity before saving main entity.
|
||||
* @see \Amasty\AdminActionsLog\Logging\ActionType\BeforeSave\Entity::execute
|
||||
*
|
||||
* @param $object
|
||||
* @return array
|
||||
*/
|
||||
public function processBeforeSave($object): array;
|
||||
|
||||
/**
|
||||
* Method for extracting and generating key => value array with data from concrete object
|
||||
* for LogDetail entity after saving main entity.
|
||||
* @see \Amasty\AdminActionsLog\Logging\ActionType\AfterSave\Entity::execute
|
||||
*
|
||||
* @param $object
|
||||
* @return array
|
||||
*/
|
||||
public function processAfterSave($object): array;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Logging;
|
||||
|
||||
interface LoggingActionInterface
|
||||
{
|
||||
/**
|
||||
* Perform logging action i.e. save product changes, save visit history, etc.
|
||||
*/
|
||||
public function execute(): void;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Logging;
|
||||
|
||||
use Magento\Framework\App\RequestInterface;
|
||||
|
||||
interface MetadataInterface
|
||||
{
|
||||
/**
|
||||
* Basic event actions identifiers.
|
||||
*/
|
||||
public const EVENT_DISPATCH = 'dispatch';
|
||||
public const EVENT_SAVE_BEFORE = 'save_before';
|
||||
public const EVENT_SAVE_AFTER = 'save_after';
|
||||
public const EVENT_DELETE = 'delete';
|
||||
public const EVENT_LOGIN = 'login';
|
||||
public const EVENT_LAYOUT_RENDER_BEFORE = 'layout_render_before';
|
||||
|
||||
/**
|
||||
* Current action's request.
|
||||
*
|
||||
* @return RequestInterface
|
||||
*/
|
||||
public function getRequest(): RequestInterface;
|
||||
|
||||
/**
|
||||
* Action's event name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEventName(): string;
|
||||
|
||||
/**
|
||||
* Action's logging object.
|
||||
*
|
||||
* @return object|null
|
||||
*/
|
||||
public function getObject(): ?object;
|
||||
|
||||
/**
|
||||
* Object key. It could be set while executing entities by schedule.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStorageEntityKey(): ?string;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Logging;
|
||||
|
||||
interface ObjectDataStorageInterface
|
||||
{
|
||||
/**
|
||||
* Method to retrieve stored object data.
|
||||
*
|
||||
* @param string $key
|
||||
* @return array|null
|
||||
*/
|
||||
public function get(string $key): ?array;
|
||||
|
||||
/**
|
||||
* Method to store object's data in storage.
|
||||
*
|
||||
* @param string $key
|
||||
* @param array $data
|
||||
*/
|
||||
public function set(string $key, array $data): void;
|
||||
|
||||
/**
|
||||
* Method to remove object's data from storage.
|
||||
*
|
||||
* @param string $key
|
||||
*/
|
||||
public function unset(string $key): void;
|
||||
|
||||
/**
|
||||
* Method to to check is data persists in storage.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function isExists(string $key): bool;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
interface LoginAttemptManagerInterface
|
||||
{
|
||||
public function saveAttempt(?string $username, int $status): void;
|
||||
|
||||
public function clear(int $period = null): void;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface;
|
||||
use Amasty\AdminActionsLog\Api\Data\LoginAttemptSearchResultsInterface;
|
||||
use Magento\Framework\Api\SearchCriteriaInterface;
|
||||
|
||||
interface LoginAttemptRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getById(int $id): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface $loginAttempt
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function save(LoginAttemptInterface $loginAttempt): LoginAttemptInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LoginAttemptInterface $loginAttempt
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function delete(LoginAttemptInterface $loginAttempt): bool;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function deleteById(int $id): bool;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\LoginAttemptSearchResultsInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getList(SearchCriteriaInterface $searchCriteria): LoginAttemptSearchResultsInterface;
|
||||
|
||||
/**
|
||||
* @param int|null $period
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function clean(?int $period = null): void;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api\Restoring;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\LogEntryInterface;
|
||||
|
||||
interface EntityRestoreHandlerInterface
|
||||
{
|
||||
/**
|
||||
* Perform restoring action by action log details
|
||||
*
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LogEntryInterface $logEntry
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\LogDetailInterface[] $logDetails
|
||||
* @return void
|
||||
*/
|
||||
public function restore(LogEntryInterface $logEntry, array $logDetails): void;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\VisitHistoryEntrySearchResultsInterface;
|
||||
use Magento\Framework\Api\SearchCriteriaInterface;
|
||||
|
||||
interface VisitHistoryEntryFinderInterface
|
||||
{
|
||||
/**
|
||||
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntrySearchResultsInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getList(SearchCriteriaInterface $searchCriteria): VisitHistoryEntrySearchResultsInterface;
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface;
|
||||
use Amasty\AdminActionsLog\Api\Data\VisitHistoryEntrySearchResultsInterface;
|
||||
use Magento\Framework\Api\SearchCriteriaInterface;
|
||||
|
||||
interface VisitHistoryEntryRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param int $id
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getById(int $id): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @param string $sessionId
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function getBySessionId(string $sessionId): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface $logEntry
|
||||
*
|
||||
* @return \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function save(VisitHistoryEntryInterface $logEntry): VisitHistoryEntryInterface;
|
||||
|
||||
/**
|
||||
* @param \Amasty\AdminActionsLog\Api\Data\VisitHistoryEntryInterface $logEntry
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function delete(VisitHistoryEntryInterface $logEntry): bool;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotDeleteException
|
||||
*/
|
||||
public function deleteById(int $id): bool;
|
||||
|
||||
/**
|
||||
* @param int|null $period
|
||||
*
|
||||
* @return void
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
* @throws \Magento\Framework\Exception\CouldNotSaveException
|
||||
*/
|
||||
public function clean(?int $period = null): void;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Api;
|
||||
|
||||
interface VisitHistoryManagerInterface
|
||||
{
|
||||
/**
|
||||
* Initialize Visit History tracking for current admin.
|
||||
*/
|
||||
public function startVisit(): void;
|
||||
|
||||
/**
|
||||
* Track Visit History end time, i.e. admin logout or session destroy.
|
||||
*
|
||||
* @param string|null $sessionId
|
||||
*/
|
||||
public function endVisit(string $sessionId = null): void;
|
||||
|
||||
/**
|
||||
* Clear whole Visit History storage.
|
||||
*
|
||||
* @param int|null $period
|
||||
*/
|
||||
public function clear(int $period = null): void;
|
||||
}
|
||||
Reference in New Issue
Block a user