Skip to content

Commit

Permalink
Fixing #5720 - Remote Database Mysql Time Zone check
Browse files Browse the repository at this point in the history
mysql.time_zone_name table DB check isn't being made on Remote Poller installation
  • Loading branch information
TheWitness committed Apr 13, 2024
1 parent 1af2680 commit c107299
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -18,6 +18,7 @@ Cacti CHANGELOG
-issue#5693: Fix Spikekill not following correct time in schedule, Improve PHP 8.3 in spikekill process
-issue#5696: When inputting Chinese to search for graphics, garbled characters appear.
-issue#5701: Bad URL formating in the templates_import.php preview mode
-issue#5720: mysql.time_zone_name table DB check isn't being made on Remote Poller installation
-feature#5692: Add a "device enabled/disabled" indicator next to the graphs
-feature#5716: Add Aruba Clearpass template

Expand Down
14 changes: 10 additions & 4 deletions lib/installer.php
Expand Up @@ -1812,7 +1812,7 @@ public function processStepWelcome() {
}

public function processStepCheckDependencies() {
global $config;
global $config, $local_db_cnn_id, $remote_db_cnn_id;
global $database_default, $database_username, $database_port;
global $rdatabase_default, $rdatabase_username, $rdatabase_port;

Expand Down Expand Up @@ -2004,7 +2004,13 @@ public function processStepCheckDependencies() {
$output .= Installer::sectionSubTitleEnd();

$output .= Installer::sectionSubTitle(__('MySQL - TimeZone Support'), 'mysql_timezone');
$mysql_timezone_access = db_fetch_assoc('SHOW COLUMNS FROM mysql.time_zone_name', false);

if ($config['poller_id'] == 1) {
$mysql_timezone_access = db_fetch_assoc('SHOW COLUMNS FROM mysql.time_zone_name', false);
} else {
$mysql_timezone_access = db_fetch_assoc('SHOW COLUMNS FROM mysql.time_zone_name', false, $local_db_cnn_id);
}

if (cacti_sizeof($mysql_timezone_access)) {
$timezone_populated = db_fetch_cell('SELECT COUNT(*) FROM mysql.time_zone_name');
if (!$timezone_populated) {
Expand Down Expand Up @@ -2404,7 +2410,7 @@ public function processStepPermissionCheck() {
$output .= Installer::sectionNormal(__('An example of how to set folder permissions is shown here, though you may need to adjust this depending on your operating system, user accounts and desired permissions.'));
$output .= Installer::sectionNote('<span class="cactiInstallSectionCode" style="width: 95%; display: inline-flex;">' . $code . '</span>', '', '', __('EXAMPLE:'));
$output .= Installer::sectionNote(__('Once installation has completed the CSRF path, should be set to read-only.'));
}else {
} else {
$output .= Installer::sectionNormal('<font color="#008000">' . __('All folders are writable') . '</font>');
}

Expand Down Expand Up @@ -3413,7 +3419,7 @@ private function upgradeDatabase() {
include_once($upgrade_file);
if (function_exists($upgrade_function)) {
call_user_func($upgrade_function);
echo PHP_EOL;
print PHP_EOL;
$ver_status = $this->checkDatabaseUpgrade($cacti_upgrade_version);
} else {
log_install_always('', __('WARNING: Failed to find upgrade function for v%s', $cacti_upgrade_version));
Expand Down

0 comments on commit c107299

Please sign in to comment.