From 6df866102df435754f869d95a0dd28b655c51de8 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Tue, 17 Sep 2024 15:36:04 +1000 Subject: [PATCH] Add config items for new enterprise.bin 'only when required' calls. --- app/Models/db_upgrades/db_5.5.0.php | 30 +++++++++++++++++++++++++++++ other/open-audit.sql | 3 +++ 2 files changed, 33 insertions(+) diff --git a/app/Models/db_upgrades/db_5.5.0.php b/app/Models/db_upgrades/db_5.5.0.php index 010851abc..99f79d038 100644 --- a/app/Models/db_upgrades/db_5.5.0.php +++ b/app/Models/db_upgrades/db_5.5.0.php @@ -135,6 +135,36 @@ $output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; log_message('info', (string)$db->getLastQuery()); +$sql = "DELETE FROM configuration WHERE name = 'product'"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + +$sql = "INSERT INTO `configuration` VALUES (NULL,'product','community','text','n','system','2000-01-01 00:00:00','Product type.')"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + +$sql = "DELETE FROM configuration WHERE name = 'license_footer'"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + +$sql = "INSERT INTO `configuration` VALUES (NULL,'license_footer','','text','n','system','2000-01-01 00:00:00','Footer text.')"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + +$sql = "DELETE FROM configuration WHERE name = 'license_limit'"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + +$sql = "INSERT INTO `configuration` VALUES (NULL,'license_limit','','number','n','system','2000-01-01 00:00:00','Licensed devices.')"; +$db->query($sql); +$output .= str_replace("\n", " ", (string)$db->getLastQuery()) . "\n\n"; +log_message('info', (string)$db->getLastQuery()); + // set our versions $sql = "UPDATE `configuration` SET `value` = '20241012' WHERE `name` = 'internal_version'"; $db->query($sql); diff --git a/other/open-audit.sql b/other/open-audit.sql index f4ea8e97f..579080b47 100644 --- a/other/open-audit.sql +++ b/other/open-audit.sql @@ -1242,6 +1242,9 @@ INSERT INTO `configuration` VALUES (NULL,'uuid',UUID(),'text','n','system','2000 INSERT INTO `configuration` VALUES (NULL,'feature_agents_advanced','n','bool','y','system','2000-01-01 00:00:00','Allow Agents to execute commands and download files.'); INSERT INTO `configuration` VALUES (NULL,'feature_queries_advanced','n','bool','y','system','2000-01-01 00:00:00','Allow Queries without a filter.'); INSERT INTO `configuration` VALUES (NULL,'feature_executables','n','bool','y','system','2000-01-01 00:00:00','Activate the linux based Executables feature.'); +INSERT INTO `configuration` VALUES (NULL,'product','community','text','n','system','2000-01-01 00:00:00','Product type.'); +INSERT INTO `configuration` VALUES (NULL,'license_footer','','text','n','system','2000-01-01 00:00:00','Footer text.'); +INSERT INTO `configuration` VALUES (NULL,'license_limit','','number','n','system','2000-01-01 00:00:00','Licensed devices.'); /*!40000 ALTER TABLE `configuration` ENABLE KEYS */; UNLOCK TABLES;