Add audit log entry for deleted blacklist records
Some checks are pending
CI / generate-phpdoc (push) Blocked by required conditions
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
Some checks are pending
CI / generate-phpdoc (push) Blocked by required conditions
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
This commit is contained in:
parent
8ec47c855f
commit
bda91ff955
2 changed files with 12 additions and 1 deletions
|
@ -19,4 +19,6 @@
|
||||||
case ENTITY_DISCOVERED = 'ENTITY_DISCOVERED';
|
case ENTITY_DISCOVERED = 'ENTITY_DISCOVERED';
|
||||||
case ENTITY_BLACKLISTED = 'ENTITY_BLACKLISTED';
|
case ENTITY_BLACKLISTED = 'ENTITY_BLACKLISTED';
|
||||||
case ENTITY_UNBLACKLISTED = 'ENTITY_UNBLACKLISTED';
|
case ENTITY_UNBLACKLISTED = 'ENTITY_UNBLACKLISTED';
|
||||||
|
|
||||||
|
case BLACKLIST_RECORD_DELETED = 'BLACKLIST_RECORD_DELETED';
|
||||||
}
|
}
|
|
@ -3,6 +3,8 @@
|
||||||
namespace FederationServer\Methods\Blacklist;
|
namespace FederationServer\Methods\Blacklist;
|
||||||
|
|
||||||
use FederationServer\Classes\Configuration;
|
use FederationServer\Classes\Configuration;
|
||||||
|
use FederationServer\Classes\Enums\AuditLogType;
|
||||||
|
use FederationServer\Classes\Managers\AuditLogManager;
|
||||||
use FederationServer\Classes\Managers\BlacklistManager;
|
use FederationServer\Classes\Managers\BlacklistManager;
|
||||||
use FederationServer\Classes\RequestHandler;
|
use FederationServer\Classes\RequestHandler;
|
||||||
use FederationServer\Classes\Validate;
|
use FederationServer\Classes\Validate;
|
||||||
|
@ -36,12 +38,19 @@
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(!BlacklistManager::blacklistExists($blacklistUuid))
|
$blacklistRecord = BlacklistManager::getBlacklistEntry($blacklistUuid);
|
||||||
|
if($blacklistRecord === null)
|
||||||
{
|
{
|
||||||
throw new RequestException('Blacklist record not found', 404);
|
throw new RequestException('Blacklist record not found', 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlacklistManager::deleteBlacklistRecord($blacklistUuid);
|
BlacklistManager::deleteBlacklistRecord($blacklistUuid);
|
||||||
|
AuditLogManager::createEntry(AuditLogType::BLACKLIST_RECORD_DELETED, sprintf(
|
||||||
|
'Blacklist record %s deleted by %s (%s)',
|
||||||
|
$blacklistUuid,
|
||||||
|
$authenticatedOperator->getName(),
|
||||||
|
$authenticatedOperator->getUuid()
|
||||||
|
), $authenticatedOperator->getUuid(), $blacklistRecord->getEntity());
|
||||||
}
|
}
|
||||||
catch (DatabaseOperationException $e)
|
catch (DatabaseOperationException $e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue