From 010499c41684e11d82cfe9fd4a42156f598b86a5 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Mon, 12 Feb 2024 10:46:19 +1000 Subject: [PATCH] Fix logic error in response helper with received data and enterprise.bin. --- app/Helpers/response_helper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Helpers/response_helper.php b/app/Helpers/response_helper.php index 1a9cc1d00..e67c76ab7 100644 --- a/app/Helpers/response_helper.php +++ b/app/Helpers/response_helper.php @@ -424,11 +424,10 @@ function response_create($instance = null) 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", "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))) { + !($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(); } - // We need Orgs for these, associated with the user, supply them here if ($response->meta->collection === 'reports' and $response->meta->action === 'execute') { $response->meta->orgs = response_get_org_list($instance->user, 'devices'); @@ -508,7 +507,7 @@ function response_create($instance = null) $db->query($sql); } 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))) { + !($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; } // TODO - Why does enterprise return this as a string?