Skip to content

Commit

Permalink
Fixing #5723 - Remote poller install does not finish
Browse files Browse the repository at this point in the history
Remote Poller installation is finished successfully but no "finish" button
  • Loading branch information
TheWitness committed Apr 13, 2024
1 parent c107299 commit d454b7e
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 59 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -19,6 +19,7 @@ Cacti CHANGELOG
-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
-issue#5723: Remote Poller installation is finished successfully but no "finish" button
-feature#5692: Add a "device enabled/disabled" indicator next to the graphs
-feature#5716: Add Aruba Clearpass template

Expand Down
4 changes: 1 addition & 3 deletions include/global.php
Expand Up @@ -333,9 +333,7 @@
$remote_db_cnn_id = db_connect_real($rdatabase_hostname, $rdatabase_username, $rdatabase_password, $rdatabase_default, $rdatabase_type, $rdatabase_port, $database_retries, $rdatabase_ssl, $rdatabase_ssl_key, $rdatabase_ssl_cert, $rdatabase_ssl_ca);
}

if ($config['is_web'] && is_object($remote_db_cnn_id) &&
$config['connection'] != 'recovery' &&
$config['cacti_db_version'] != 'new_install') {
if ($config['is_web'] && is_object($remote_db_cnn_id) && $config['connection'] != 'recovery' && $config['cacti_db_version'] != 'new_install' && !defined('IN_CACTI_INSTALL')) {

// Connection worked, so now override the default settings so that it will always utilize the remote connection
$database_default = $rdatabase_default;
Expand Down
18 changes: 18 additions & 0 deletions install/functions.php
Expand Up @@ -876,6 +876,24 @@ function remote_update_config_file() {
return $failure;
}

/**
* set_install_config_option - Set a config option into the local database only
*
* @param $config_name - the name of the configuration setting as specified $settings array
* @param $value - the values to be saved
*
* @return null - nothing is returned
*/
function set_install_config_option($name, $value) {
global $local_db_cnn_id;

if (is_object($local_db_cnn_id)) {
db_execute_prepared('REPLACE INTO settings (name, value) VALUES (?, ?)', array($name, $value), false, $local_db_cnn_id);
} else {
set_config_option($name, $value);
}
}

function import_colors() {
global $config;

Expand Down
2 changes: 1 addition & 1 deletion lib/functions.php
Expand Up @@ -5465,7 +5465,7 @@ function poller_maintenance () {
$command_string = cacti_escapeshellcmd(read_config_option('path_php_binary'));

// If its not set, just assume its in the path
if (trim($command_string) == '') {
if (empty($command_string) || trim($command_string) == '') {
$command_string = 'php';
}

Expand Down

0 comments on commit d454b7e

Please sign in to comment.