From 8761e04a3f94fa6175be0ef398e5533b31753429 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Thu, 27 Jan 2022 08:08:02 +1000 Subject: [PATCH] Version increases to 4.3.2. --- code_igniter/application/config/config.php | 4 +- .../application/controllers/database.php | 5 ++ .../controllers/db_upgrades/db_4.3.2.php | 50 +++++++++++++++++++ other/openaudit_mysql.sql | 4 +- 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 code_igniter/application/controllers/db_upgrades/db_4.3.2.php diff --git a/code_igniter/application/config/config.php b/code_igniter/application/config/config.php index 89624e141..1dccddb88 100644 --- a/code_igniter/application/config/config.php +++ b/code_igniter/application/config/config.php @@ -2,8 +2,8 @@ if ( ! defined('BASEPATH')) { exit('No direct script access allowed'); } -$config['web_internal_version'] = '20211213'; -$config['web_display_version'] = '4.3.1'; +$config['web_internal_version'] = '20220126'; +$config['web_display_version'] = '4.3.2'; $config['microtime'] = microtime(true); // $config['debug'] = false; /* diff --git a/code_igniter/application/controllers/database.php b/code_igniter/application/controllers/database.php index 3d50b907c..43faa940d 100644 --- a/code_igniter/application/controllers/database.php +++ b/code_igniter/application/controllers/database.php @@ -926,6 +926,11 @@ public function update() include "db_upgrades/db_4.3.1.php"; } + if (($db_internal_version < '20220126') and ($this->db->platform() == 'mysql' or $this->db->platform() == 'mysqli')) { + # upgrade for 4.3.2 + include "db_upgrades/db_4.3.2.php"; + } + $this->data['include'] = 'v_database_update'; $this->data['heading'] = 'Database Upgrade'; $this->data['success'] = "Database upgraded successfully. New database version is ".$this->config->config['display_version']." (".$this->config->config['internal_version'].")"; diff --git a/code_igniter/application/controllers/db_upgrades/db_4.3.2.php b/code_igniter/application/controllers/db_upgrades/db_4.3.2.php new file mode 100644 index 000000000..019b661d1 --- /dev/null +++ b/code_igniter/application/controllers/db_upgrades/db_4.3.2.php @@ -0,0 +1,50 @@ + +# +# For further information on Open-AudIT or for a license other than AGPL please see +# www.opmantek.com or email contact@opmantek.com +# +# ***************************************************************************** +* +**/ + +/* + +UPDATE `configuration` SET `value` = '20220126' WHERE `name` = 'internal_version'; + +UPDATE `configuration` SET `value` = '4.3.2' WHERE `name` = 'display_version'; +*/ + +$this->log_db('Upgrade database to 4.3.2 commenced'); + +// set our versions +$sql = "UPDATE `configuration` SET `value` = '20220126' WHERE `name` = 'internal_version'"; +$this->db->query($sql); +$this->log_db($this->db->last_query() . ';'); + +$sql = "UPDATE `configuration` SET `value` = '4.3.2' WHERE `name` = 'display_version'"; +$this->db->query($sql); +$this->log_db($this->db->last_query() . ';'); + +$this->log_db('Upgrade database to 4.3.2 completed'); +$this->config->config['internal_version'] = '20220126'; +$this->config->config['display_version'] = '4.3.2'; diff --git a/other/openaudit_mysql.sql b/other/openaudit_mysql.sql index a811b3ee9..e39d80ebc 100644 --- a/other/openaudit_mysql.sql +++ b/other/openaudit_mysql.sql @@ -941,12 +941,12 @@ INSERT INTO `configuration` VALUES (NULL,'discovery_sunos_use_sudo','y','bool',' INSERT INTO `configuration` VALUES (NULL,'discovery_use_dns','y','bool','y','system','2000-01-01 00:00:00','Should we use DNS for looking up the hostname and domain.'); INSERT INTO `configuration` VALUES (NULL,'discovery_use_ipmi','y','bool','y','system','2000-01-01 00:00:00','Should we use ipmitool for discovering management ports if ipmitool is installed.'); INSERT INTO `configuration` VALUES (NULL,'discovery_use_vintage_service','n','bool','y','system','2000-01-01 00:00:00','On Windows, use the old way of running discovery with the Apache service account.'); -INSERT INTO `configuration` VALUES (NULL,'display_version','4.3.1','text','n','system','2000-01-01 00:00:00','The version shown on the web pages.'); +INSERT INTO `configuration` VALUES (NULL,'display_version','4.3.2','text','n','system','2000-01-01 00:00:00','The version shown on the web pages.'); INSERT INTO `configuration` VALUES (NULL,'download_reports','y','bool','y','system','2000-01-01 00:00:00','Tells Open-AudIT to advise the browser to download as a file or display the csv, xml, json reports.'); INSERT INTO `configuration` VALUES (NULL,'graph_days','30','number','y','system','2000-01-01 00:00:00','The number of days to report on for the Enterprise graphs.'); INSERT INTO `configuration` VALUES (NULL,'gui_trim_characters','25','number','y','system','2000-01-01 00:00:00','When showing a table of information in the web GUI, replace characters greater than this with \"...\".'); INSERT INTO `configuration` VALUES (NULL,'homepage','summaries','text','y','system','2000-01-01 00:00:00','Any links to the default page should be directed to this endpoint.'); -INSERT INTO `configuration` VALUES (NULL,'internal_version','20211213','number','n','system','2000-01-01 00:00:00','The internal numerical version.'); +INSERT INTO `configuration` VALUES (NULL,'internal_version','20220126','number','n','system','2000-01-01 00:00:00','The internal numerical version.'); INSERT INTO `configuration` VALUES (NULL,'log_level','5','number','y','system','2000-01-01 00:00:00','Tells Open-AudIT which severity of event (at least) should be logged.'); INSERT INTO `configuration` VALUES (NULL,'log_retain_level_0','180','number','y','system','2000-01-01 00:00:00','Tells Open-AudIT how many days to keep logs with severity 0.'); INSERT INTO `configuration` VALUES (NULL,'log_retain_level_1','180','number','y','system','2000-01-01 00:00:00','Tells Open-AudIT how many days to keep logs with severity 1.');