Skip to content

Commit

Permalink
Allow received data to go to enterprise.bin for the configuration col…
Browse files Browse the repository at this point in the history
…lection (updating a license).
  • Loading branch information
mark-unwin committed Feb 9, 2024
1 parent 1b55cbc commit 613529c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Helpers/response_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ function response_create($instance = null)
$permission_requested = $response->meta->permission_requested;
if (!empty($config->enterprise_binary) and $db->tableExists('enterprise')) {
$function = $response->meta->collection . '_' . $response->meta->action;
if (!in_array($function, array("baselines_create", "baselines_execute", "clusters_create", "collectors_create", "collectors_register", "dashboards_create", "discovery_scan_options_create", "discovery_scan_options_update", "racks_create", "roles_create", "tasks_create", "widgets_create", "widgets_update")) and
if (!in_array($function, array("baselines_create", "baselines_execute", "clusters_create", "collectors_create", "collectors_register", "configuration_update", "dashboards_create", "discovery_scan_options_create", "discovery_scan_options_update", "racks_create", "roles_create", "tasks_create", "widgets_create", "widgets_update")) and
!($function !== 'configuration_update' and ($response->meta->id !== $config->license_string_id or $response->meta->id !== $config->license_string_collector_id))) {
$received_data = $response->meta->received_data;
$response->meta->received_data = array();
Expand Down Expand Up @@ -507,7 +507,7 @@ function response_create($instance = null)
$sql = "DELETE FROM enterprise WHERE DATE(timestamp) < SUBDATE(CURDATE(), 0)";
$db->query($sql);
}
if (!in_array($function, array("baselines_create", "baselines_execute", "clusters_create", "collectors_create", "collectors_register", "dashboards_create", "discovery_scan_options_create", "discovery_scan_options_update", "racks_create", "roles_create", "tasks_create", "widgets_create", "widgets_update")) and
if (!in_array($function, array("baselines_create", "baselines_execute", "clusters_create", "collectors_create", "collectors_register", "configuration_update", "dashboards_create", "discovery_scan_options_create", "discovery_scan_options_update", "racks_create", "roles_create", "tasks_create", "widgets_create", "widgets_update")) and
!($function !== 'configuration_update' and ($response->meta->id !== $config->license_string_id or $response->meta->id !== $config->license_string_collector_id))) {
$response->meta->received_data = $received_data;
}
Expand Down

0 comments on commit 613529c

Please sign in to comment.