diff --git a/app/Controller/TagsController.php b/app/Controller/TagsController.php index d1cabe53f..073fd03a5 100644 --- a/app/Controller/TagsController.php +++ b/app/Controller/TagsController.php @@ -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']); diff --git a/app/Model/Log.php b/app/Model/Log.php index 68bcb22eb..2155a2e99 100644 --- a/app/Model/Log.php +++ b/app/Model/Log.php @@ -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',