mirror of https://github.com/MISP/MISP
fix: [logging] fixed using removeTagFromObject()
- no longer creates erroneous log entries when unpublishing the eventpull/9613/head
parent
6a2986be6a
commit
dc0cb15675
|
@ -820,6 +820,15 @@ class TagsController extends AppController
|
|||
}
|
||||
$message = 'Global tag ' . $existingTag['Tag']['name'] . '(' . $existingTag['Tag']['id'] . ') successfully attached to ' . $objectType . '(' . $object[$objectType]['id'] . ').';
|
||||
}
|
||||
$this->loadModel('Log');
|
||||
$this->Log->createLogEntry(
|
||||
$this->Auth->user(),
|
||||
'attachTagToObject',
|
||||
$objectType,
|
||||
$object[$objectType]['id'],
|
||||
$message,
|
||||
null
|
||||
);
|
||||
$successes++;
|
||||
} else {
|
||||
$fails[] = __('Failed to attach tag to object.');
|
||||
|
@ -896,6 +905,17 @@ class TagsController extends AppController
|
|||
$result = $this->$objectType->$connectorObject->delete($existingAssociation[$connectorObject]['id']);
|
||||
if ($result) {
|
||||
$message = __('%s tag %s (%s) successfully removed from %s(%s).', $local ? __('Local') : __('Global'), $existingTag['Tag']['name'], $existingTag['Tag']['id'], $objectType, $object[$objectType]['id']);
|
||||
$this->loadModel('Log');
|
||||
$this->Log->createLogEntry(
|
||||
$this->Auth->user(),
|
||||
'removeTagFromObject',
|
||||
$objectType,
|
||||
$object[$objectType]['id'],
|
||||
$message,
|
||||
__(
|
||||
'',
|
||||
)
|
||||
);
|
||||
if (!$local) {
|
||||
if ($objectType === 'Attribute') {
|
||||
$this->Attribute->touch($object['Attribute']['id']);
|
||||
|
|
|
@ -38,6 +38,7 @@ class Log extends AppModel
|
|||
'add',
|
||||
'admin_email',
|
||||
'attachTags',
|
||||
'attachTagToObject',
|
||||
'auth',
|
||||
'auth_fail',
|
||||
'auth_alert',
|
||||
|
@ -78,6 +79,7 @@ class Log extends AppModel
|
|||
'registration',
|
||||
'registration_error',
|
||||
'remove_dead_workers',
|
||||
'removeTagFromObject',
|
||||
'request',
|
||||
'request_delegation',
|
||||
'reset_auth_key',
|
||||
|
|
Loading…
Reference in New Issue