From 351b8fcb97133828decbe56ce1b8b57a278181d4 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Feb 2022 16:44:21 +0100 Subject: [PATCH] Fix --- pandora_console/include/functions_config.php | 688 +------------------ 1 file changed, 12 insertions(+), 676 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index f4507e0523..ccf315072f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -71,7 +71,7 @@ function config_update_value($token, $value, $noticed=false) // Include functions_io to can call __() function. include_once $config['homedir'].'/include/functions_io.php'; - if ($token == 'list_ACL_IPs_for_API') { + if ($token === 'list_ACL_IPs_for_API') { $value = str_replace( [ "\r\n", @@ -161,7 +161,6 @@ function config_update_config() return false; } - $tokenUpdated = []; $error_update = []; $errors = []; $warnings = []; @@ -177,56 +176,38 @@ function config_update_config() case 'general': if (config_update_value('language', (string) get_parameter('language'), true) === false) { $error_update[] = __('Language settings'); - } else { - $tokenUpdated[] = __('Language settings'); } if (config_update_value('remote_config', (string) get_parameter('remote_config'), true) === false) { $error_update[] = __('Remote config directory'); - } else { - $tokenUpdated[] = __('Remote config directory'); } if (config_update_value('phantomjs_bin', (string) get_parameter('phantomjs_bin'), true) === false) { $error_update[] = __('phantomjs config directory'); - } else { - $tokenUpdated[] = __('phantomjs config directory'); } if (config_update_value('loginhash_pwd', io_input_password((string) get_parameter('loginhash_pwd')), true) === false) { $error_update[] = __('Auto login (hash) password'); - } else { - $tokenUpdated[] = __('Auto login (hash) password'); } if (config_update_value('timesource', (string) get_parameter('timesource'), true) === false) { $error_update[] = __('Time source'); - } else { - $tokenUpdated[] = __('Time source'); } if (config_update_value('autoupdate', (bool) get_parameter('autoupdate'), true) === false) { $error_update[] = __('Automatic check for updates'); - } else { - $tokenUpdated[] = __('Automatic check for updates'); } if (config_update_value('cert_path', get_parameter('cert_path'), true) === false) { $error_update[] = __('SSL cert path'); - } else { - $tokenUpdated[] = __('SSL cert path'); } if (config_update_value('https', (bool) get_parameter('https'), true) === false) { $error_update[] = __('Enforce https'); - } else { - $tokenUpdated[] = __('Enforce https'); } if (config_update_value('use_cert', (bool) get_parameter('use_cert'), true) === false) { $error_update[] = __('Use cert.'); - } else { - $tokenUpdated[] = __('Use cert.'); } $attachment_store = (string) get_parameter('attachment_store'); @@ -247,69 +228,47 @@ function config_update_config() if (config_update_value('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'), true) === false) { $error_update[] = __('IP list with API access'); - } else { - $tokenUpdated[] = __('IP list with API access'); } if (config_update_value('api_password', io_input_password(get_parameter('api_password')), true) === false) { $error_update[] = __('API password'); - } else { - $tokenUpdated[] = __('API password'); } if (config_update_value('activate_gis', (bool) get_parameter('activate_gis'), true) === false) { $error_update[] = __('Enable GIS features'); - } else { - $tokenUpdated[] = __('Enable GIS features'); } if (config_update_value('integria_inventory', get_parameter('integria_inventory'), true) === false) { $error_update[] = __('Integria inventory'); - } else { - $tokenUpdated[] = __('Integria inventory'); } if (config_update_value('integria_api_password', io_input_password(get_parameter('integria_api_password')), true) === false) { $error_update[] = __('Integria API password'); - } else { - $tokenUpdated[] = __('Integria API password'); } if (config_update_value('integria_url', get_parameter('integria_url'), true) === false) { $error_update[] = __('Integria URL'); - } else { - $tokenUpdated[] = __('Integria URL'); } if (config_update_value('activate_netflow', (bool) get_parameter('activate_netflow'), true) === false) { $error_update[] = __('Enable Netflow'); - } else { - $tokenUpdated[] = __('Enable Netflow'); } $timezone = (string) get_parameter('timezone'); if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) { $error_update[] = __('Timezone setup'); - } else { - $tokenUpdated[] = __('Timezone setup'); } if (config_update_value('sound_alert', get_parameter('sound_alert'), true) === false) { $error_update[] = __('Sound for Alert fired'); - } else { - $tokenUpdated[] = __('Sound for Alert fired'); } if (config_update_value('sound_critical', get_parameter('sound_critical'), true) === false) { $error_update[] = __('Sound for Monitor critical'); - } else { - $tokenUpdated[] = __('Sound for Monitor critical'); } if (config_update_value('sound_warning', get_parameter('sound_warning'), true) === false) { $error_update[] = __('Sound for Monitor warning'); - } else { - $tokenUpdated[] = __('Sound for Monitor warning'); } // Update of Pandora FMS license. @@ -329,158 +288,106 @@ function config_update_config() if (config_update_value('public_url', get_parameter('public_url'), true) === false) { $error_update[] = __('Public URL'); - } else { - $tokenUpdated[] = __('Public URL'); } if (config_update_value('force_public_url', get_parameter_switch('force_public_url'), true) === false) { $error_update[] = __('Force use Public URL'); - } else { - $tokenUpdated[] = __('Force use Public URL'); } if (config_update_value('public_url_exclusions', get_parameter('public_url_exclusions'), true) === false) { $error_update[] = __('Public URL host exclusions'); - } else { - $tokenUpdated[] = __('Public URL host exclusions'); } if (config_update_value('referer_security', get_parameter('referer_security'), true) === false) { $error_update[] = __('Referer security'); - } else { - $tokenUpdated[] = __('Referer security'); } if (config_update_value('event_storm_protection', get_parameter('event_storm_protection', 0), true) === false) { $error_update[] = __('Event storm protection'); - } else { - $tokenUpdated[] = __('Event storm protection'); } if (config_update_value('command_snapshot', get_parameter('command_snapshot'), true) === false) { $error_update[] = __('Command Snapshot'); - } else { - $tokenUpdated[] = __('Command Snapshot'); } if (config_update_value('use_custom_encoding', get_parameter('use_custom_encoding', 0), true) === false) { $error_update[] = __('Use custom encoding'); - } else { - $tokenUpdated[] = __('Use custom encoding'); } if (config_update_value('server_log_dir', io_safe_input(strip_tags(io_safe_output(get_parameter('server_log_dir')))), true) === false) { $error_update[] = __('Server logs directory'); - } else { - $tokenUpdated[] = __('Server logs directory'); } if (config_update_value('max_log_size', get_parameter('max_log_size'), true) === false) { $error_update[] = __('Log size limit in system logs viewer extension'); - } else { - $tokenUpdated[] = __('Log size limit in system logs viewer extension'); } if (config_update_value('tutorial_mode', get_parameter('tutorial_mode'), true) === false) { $error_update[] = __('Tutorial mode'); - } else { - $tokenUpdated[] = __('Tutorial mode'); } if (config_update_value('past_planned_downtimes', get_parameter('past_planned_downtimes'), true) === false) { $error_update[] = __('Allow create scheduled downtimes in the past'); - } else { - $tokenUpdated[] = __('Allow create scheduled downtimes in the past'); } if (config_update_value('limit_parameters_massive', get_parameter('limit_parameters_massive'), true) === false) { $error_update[] = __('Limit parameters bulk'); - } else { - $tokenUpdated[] = __('Limit parameters bulk'); } if (config_update_value('identification_reminder', get_parameter('identification_reminder'), true) === false) { $error_update[] = __('Identification_reminder'); - } else { - $tokenUpdated[] = __('Identification_reminder'); } if (config_update_value('include_agents', (bool) get_parameter('include_agents'), true) === false) { $error_update[] = __('Include_agents'); - } else { - $tokenUpdated[] = __('Include_agents'); } if (config_update_value('alias_as_name', get_parameter('alias_as_name'), true) === false) { $error_update[] = __('alias_as_name'); - } else { - $tokenUpdated[] = __('alias_as_name'); } if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) { $error_update[] = __('Console log enabled'); - } else { - $tokenUpdated[] = __('Console log enabled'); } if (config_update_value('audit_log_enabled', get_parameter('audit_log_enabled'), true) === false) { $error_update[] = __('Audit log enabled'); - } else { - $tokenUpdated[] = __('Audit log enabled'); } if (config_update_value('module_custom_id_ro', get_parameter('module_custom_id_ro'), true) === false) { $error_update[] = __('Module Custom ID read only'); - } else { - $tokenUpdated[] = __('Module Custom ID read only'); } if (config_update_value('unique_ip', get_parameter('unique_ip'), true) === false) { $error_update[] = __('Unique IP'); - } else { - $tokenUpdated[] = __('Unique IP'); } if (config_update_value('email_smtpServer', get_parameter('email_smtpServer'), true) === false) { $error_update[] = __('Server SMTP'); - } else { - $tokenUpdated[] = __('Server SMTP'); } if (config_update_value('email_from_dir', get_parameter('email_from_dir'), true) === false) { $error_update[] = __('From dir'); - } else { - $tokenUpdated[] = __('From dir'); } if (config_update_value('email_from_name', get_parameter('email_from_name'), true) === false) { $error_update[] = __('From name'); - } else { - $tokenUpdated[] = __('From name'); } if (config_update_value('email_smtpPort', (int) get_parameter('email_smtpPort'), true) === false) { $error_update[] = __('Port SMTP'); - } else { - $tokenUpdated[] = __('Port SMTP'); } if (config_update_value('email_encryption', get_parameter('email_encryption'), true) === false) { $error_update[] = __('Encryption'); - } else { - $tokenUpdated[] = __('Encryption'); } if (config_update_value('email_username', get_parameter('email_username'), true) === false) { $error_update[] = __('Email user'); - } else { - $tokenUpdated[] = __('Email user'); } if (config_update_value('email_password', io_input_password(get_parameter('email_password')), true) === false) { $error_update[] = __('Email password'); - } else { - $tokenUpdated[] = __('Email password'); } break; @@ -488,137 +395,93 @@ function config_update_config() if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { if (config_update_value('trap2agent', (string) get_parameter('trap2agent'), true) === false) { $error_update[] = __('Forward SNMP traps to agent (if exist)'); - } else { - $tokenUpdated[] = __('Forward SNMP traps to agent (if exist)'); } if (config_update_value('acl_enterprise', get_parameter('acl_enterprise'), true) === false) { $error_update[] = __('Use Enterprise ACL System'); - } else { - $tokenUpdated[] = __('Use Enterprise ACL System'); } if (config_update_value('metaconsole', get_parameter('metaconsole'), true) === false) { $error_update[] = __('Activate Metaconsole'); - } else { - $tokenUpdated[] = __('Activate Metaconsole'); } if (config_update_value('collection_max_size', get_parameter('collection_max_size'), true) === false) { $error_update[] = __('Size of collection'); - } else { - $tokenUpdated[] = __('Size of collection'); } if (config_update_value('event_replication', (int) get_parameter('event_replication'), true) === false) { $error_update[] = __('Events replication'); - } else { - $tokenUpdated[] = __('Events replication'); } if ((int) get_parameter('event_replication') === 1) { if (config_update_value('replication_interval', (int) get_parameter('replication_interval'), true) === false) { $error_update[] = __('Replication interval'); - } else { - $tokenUpdated[] = __('Replication interval'); } if (config_update_value('replication_limit', (int) get_parameter('replication_limit'), true) === false) { $error_update[] = __('Replication limit'); - } else { - $tokenUpdated[] = __('Replication limit'); } if (config_update_value('replication_mode', (string) get_parameter('replication_mode'), true) === false) { $error_update[] = __('Replication mode'); - } else { - $tokenUpdated[] = __('Replication mode'); } if (config_update_value('show_events_in_local', (string) get_parameter('show_events_in_local'), true) === false) { $error_update[] = __('Show events list in local console (read only)'); - } else { - $tokenUpdated[] = __('Show events list in local console (read only)'); } } if (config_update_value('replication_dbengine', (string) get_parameter('replication_dbengine'), true) === false) { $error_update[] = __('Replication DB engine'); - } else { - $tokenUpdated[] = __('Replication DB engine'); } if (config_update_value('replication_dbhost', (string) get_parameter('replication_dbhost'), true) === false) { $error_update[] = __('Replication DB host'); - } else { - $tokenUpdated[] = __('Replication DB host'); } if (config_update_value('replication_dbname', (string) get_parameter('replication_dbname'), true) === false) { $error_update[] = __('Replication DB database'); - } else { - $tokenUpdated[] = __('Replication DB database'); } if (config_update_value('replication_dbuser', (string) get_parameter('replication_dbuser'), true) === false) { $error_update[] = __('Replication DB user'); - } else { - $tokenUpdated[] = __('Replication DB user'); } if (config_update_value('replication_dbpass', io_input_password((string) get_parameter('replication_dbpass')), true) === false) { $error_update[] = __('Replication DB password'); - } else { - $tokenUpdated[] = __('Replication DB password'); } if (config_update_value('replication_dbport', (string) get_parameter('replication_dbport'), true) === false) { $error_update[] = __('Replication DB port'); - } else { - $tokenUpdated[] = __('Replication DB port'); } if (config_update_value('metaconsole_agent_cache', (int) get_parameter('metaconsole_agent_cache'), true) === false) { $error_update[] = __('Metaconsole agent cache'); - } else { - $tokenUpdated[] = __('Metaconsole agent cache'); } if (config_update_value('log_collector', (bool) get_parameter('log_collector'), true) === false) { $error_update[] = __('Activate Log Collector'); - } else { - $tokenUpdated[] = __('Activate Log Collector'); } if (config_update_value('enable_update_manager', get_parameter('enable_update_manager'), true) === false) { $error_update[] = __('Enable Update Manager'); - } else { - $tokenUpdated[] = __('Enable Update Manager'); } if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) { $error_update[] = __('Ipam Ocuppied Manager Critical'); - } else { - $tokenUpdated[] = __('Ipam Ocuppied Manager Critical'); } if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) { $error_update[] = __('Ipam Ocuppied Manager Warning'); - } else { - $tokenUpdated[] = __('Ipam Ocuppied Manager Warning'); } if (config_update_value('sap_license', get_parameter('sap_license'), true) === false) { $error_update[] = __('SAP/R3 Plugin Licence'); - } else { - $tokenUpdated[] = __('SAP/R3 Plugin Licence'); } $inventory_changes_blacklist = get_parameter('inventory_changes_blacklist', []); if (config_update_value('inventory_changes_blacklist', implode(',', $inventory_changes_blacklist), true) === false) { $error_update[] = __('Inventory changes blacklist'); - } else { - $tokenUpdated[] = __('Inventory changes blacklist'); } } break; @@ -627,74 +490,50 @@ function config_update_config() if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === 1) { if (config_update_value('enable_pass_policy', get_parameter('enable_pass_policy'), true) === false) { $error_update[] = __('Enable password policy'); - } else { - $tokenUpdated[] = __('Enable password policy'); } if (config_update_value('pass_size', get_parameter('pass_size'), true) === false) { $error_update[] = __('Min. size password'); - } else { - $tokenUpdated[] = __('Min. size password'); } if (config_update_value('pass_expire', get_parameter('pass_expire'), true) === false) { $error_update[] = __('Password expiration'); - } else { - $tokenUpdated[] = __('Password expiration'); } if (config_update_value('first_login', get_parameter('first_login'), true) === false) { $error_update[] = __('Force change password on first login'); - } else { - $tokenUpdated[] = __('Force change password on first login'); } if (config_update_value('mins_fail_pass', get_parameter('mins_fail_pass'), true) === false) { $error_update[] = __('User blocked if login fails'); - } else { - $tokenUpdated[] = __('User blocked if login fails'); } if (config_update_value('number_attempts', get_parameter('number_attempts'), true) === false) { $error_update[] = __('Number of failed login attempts'); - } else { - $tokenUpdated[] = __('Number of failed login attempts'); } if (config_update_value('pass_needs_numbers', get_parameter('pass_needs_numbers'), true) === false) { $error_update[] = __('Password must have numbers'); - } else { - $tokenUpdated[] = __('Password must have numbers'); } if (config_update_value('pass_needs_symbols', get_parameter('pass_needs_symbols'), true) === false) { $error_update[] = __('Password must have symbols'); - } else { - $tokenUpdated[] = __('Password must have symbols'); } if (config_update_value('enable_pass_policy_admin', get_parameter('enable_pass_policy_admin'), true) === false) { $error_update[] = __('Apply password policy to admin users'); - } else { - $tokenUpdated[] = __('Apply password policy to admin users'); } if (config_update_value('enable_pass_history', get_parameter('enable_pass_history'), true) === false) { $error_update[] = __('Enable password history'); - } else { - $tokenUpdated[] = __('Enable password history'); } if (config_update_value('compare_pass', get_parameter('compare_pass'), true) === false) { $error_update[] = __('Compare previous password'); - } else { - $tokenUpdated[] = __('Compare previous password'); } if (config_update_value('reset_pass_option', (bool) get_parameter('reset_pass_option'), true) === false) { $error_update[] = __('Activate reset password'); - } else { - $tokenUpdated[] = __('Activate reset password'); } } break; @@ -703,307 +542,206 @@ function config_update_config() // AUTHENTICATION SETUP. if (config_update_value('auth', get_parameter('auth'), true) === false) { $error_update[] = __('Authentication method'); - } else { - $tokenUpdated[] = __('Authentication method'); } if (config_update_value('autocreate_remote_users', get_parameter('autocreate_remote_users'), true) === false) { $error_update[] = __('Autocreate remote users'); - } else { - $tokenUpdated[] = __('Autocreate remote users'); } if (config_update_value('default_remote_profile', get_parameter('default_remote_profile'), true) === false) { $error_update[] = __('Autocreate profile'); - } else { - $tokenUpdated[] = __('Autocreate profile'); } if (config_update_value('default_remote_group', get_parameter('default_remote_group'), true) === false) { $error_update[] = __('Autocreate profile group'); - } else { - $tokenUpdated[] = __('Autocreate profile group'); } if (config_update_value('default_assign_tags', implode(',', get_parameter('default_assign_tags')), true) === false) { $error_update[] = __('Autocreate profile tags'); - } else { - $tokenUpdated[] = __('Autocreate profile tags'); } if (config_update_value('default_no_hierarchy', (int) get_parameter('default_no_hierarchy'), true) === false) { $error_update[] = __('Automatically assigned no hierarchy'); - } else { - $tokenUpdated[] = __('Automatically assigned no hierarchy'); } if (config_update_value('autocreate_blacklist', get_parameter('autocreate_blacklist'), true) === false) { $error_update[] = __('Autocreate blacklist'); - } else { - $tokenUpdated[] = __('Autocreate blacklist'); } if (config_update_value('ad_server', get_parameter('ad_server'), true) === false) { $error_update[] = __('Active directory server'); - } else { - $tokenUpdated[] = __('Active directory server'); } if (config_update_value('ad_port', get_parameter('ad_port'), true) === false) { $error_update[] = __('Active directory port'); - } else { - $tokenUpdated[] = __('Active directory port'); } if (config_update_value('ad_start_tls', get_parameter('ad_start_tls'), true) === false) { $error_update[] = __('Start TLS'); - } else { - $tokenUpdated[] = __('Start TLS'); } if (config_update_value('ad_advanced_config', get_parameter('ad_advanced_config'), true) === false) { $error_update[] = __('Advanced Config AD'); - } else { - $tokenUpdated[] = __('Advanced Config AD'); } if (config_update_value('ldap_advanced_config', get_parameter('ldap_advanced_config'), true) === false) { $error_update[] = __('Advanced Config LDAP'); - } else { - $tokenUpdated[] = __('Advanced Config LDAP'); } if (config_update_value('ad_domain', get_parameter('ad_domain'), true) === false) { $error_update[] = __('Domain'); - } else { - $tokenUpdated[] = __('Domain'); } if (config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'), true) === false) { $error_update[] = __('Advanced Permisions AD'); - } else { - $tokenUpdated[] = __('Advanced Permisions AD'); } if (config_update_value('ldap_adv_perms', get_parameter('ldap_adv_perms'), true) === false) { $error_update[] = __('Advanced Permissions LDAP'); - } else { - $tokenUpdated[] = __('Advanced Permissions LDAP'); } if (config_update_value('ldap_server', get_parameter('ldap_server'), true) === false) { $error_update[] = __('LDAP server'); - } else { - $tokenUpdated[] = __('LDAP server'); } if (config_update_value('ldap_port', get_parameter('ldap_port'), true) === false) { $error_update[] = __('LDAP port'); - } else { - $tokenUpdated[] = __('LDAP port'); } if (config_update_value('ldap_version', get_parameter('ldap_version'), true) === false) { $error_update[] = __('LDAP version'); - } else { - $tokenUpdated[] = __('LDAP version'); } if (config_update_value('ldap_start_tls', get_parameter('ldap_start_tls'), true) === false) { $error_update[] = __('Start TLS'); - } else { - $tokenUpdated[] = __('Start TLS'); } if (config_update_value('ldap_base_dn', get_parameter('ldap_base_dn'), true) === false) { $error_update[] = __('Base DN'); - } else { - $tokenUpdated[] = __('Base DN'); } if (config_update_value('ldap_login_attr', get_parameter('ldap_login_attr'), true) === false) { $error_update[] = __('Login attribute'); - } else { - $tokenUpdated[] = __('Login attribute'); } if (config_update_value('ldap_admin_login', get_parameter('ldap_admin_login'), true) === false) { $error_update[] = __('Admin LDAP login'); - } else { - $tokenUpdated[] = __('Admin LDAP login'); } if (config_update_value('ldap_admin_pass', io_input_password(io_safe_output(get_parameter('ldap_admin_pass'))), true) === false) { $error_update[] = __('Admin LDAP password'); - } else { - $tokenUpdated[] = __('Admin LDAP password'); } if (config_update_value('fallback_local_auth', get_parameter('fallback_local_auth'), true) === false) { $error_update[] = __('Fallback to local authentication'); - } else { - $tokenUpdated[] = __('Fallback to local authentication'); } if (config_update_value('ldap_login_user_attr', get_parameter('ldap_login_user_attr'), true) === false) { $error_update[] = __('Login user attribute'); - } else { - $tokenUpdated[] = __('Login user attribute'); } if (config_update_value('ldap_function', get_parameter('ldap_function'), true) === false) { $error_update[] = __('LDAP function'); - } else { - $tokenUpdated[] = __('LDAP function'); } if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 0) { if (config_update_value('ldap_save_password', get_parameter('ldap_save_password'), true) === false) { $error_update[] = __('Save Password'); - } else { - $tokenUpdated[] = __('Save Password'); } } else if (isset($config['fallback_local_auth']) === false && (int) $config['fallback_local_auth'] === 1) { config_update_value('ldap_save_password', 1); - $tokenUpdated[] = __('Save Password'); } if (config_update_value('ldap_save_profile', get_parameter('ldap_save_profile'), true) === false) { $error_update[] = __('Save profile'); - } else { - $tokenUpdated[] = __('Save profile'); } if (config_update_value('rpandora_server', get_parameter('rpandora_server'), true) === false) { $error_update[] = __('MySQL host'); - } else { - $tokenUpdated[] = __('MySQL host'); } if (config_update_value('rpandora_port', get_parameter('rpandora_port'), true) === false) { $error_update[] = __('MySQL port'); - } else { - $tokenUpdated[] = __('MySQL port'); } if (config_update_value('rpandora_dbname', get_parameter('rpandora_dbname'), true) === false) { $error_update[] = __('Database name'); - } else { - $tokenUpdated[] = __('Database name'); } if (config_update_value('rpandora_user', get_parameter('rpandora_user'), true) === false) { $error_update[] = __('User'); - } else { - $tokenUpdated[] = __('User'); } if (config_update_value('rpandora_pass', io_input_password(get_parameter('rpandora_pass')), true) === false) { $error_update[] = __('Password'); - } else { - $tokenUpdated[] = __('Password'); } if (config_update_value('rintegria_server', get_parameter('rintegria_server'), true) === false) { $error_update[] = __('Integria host'); - } else { - $tokenUpdated[] = __('Integria host'); } if (config_update_value('rintegria_port', get_parameter('rintegria_port'), true) === false) { $error_update[] = __('MySQL port'); - } else { - $tokenUpdated[] = __('MySQL port'); } if (config_update_value('rintegria_dbname', get_parameter('rintegria_dbname'), true) === false) { $error_update[] = __('Database name'); - } else { - $tokenUpdated[] = __('Database name'); } if (config_update_value('rintegria_user', get_parameter('rintegria_user'), true) === false) { $error_update[] = __('User'); - } else { - $tokenUpdated[] = __('User'); } if (config_update_value('rintegria_pass', io_input_password(get_parameter('rintegria_pass')), true) === false) { $error_update[] = __('Password'); - } else { - $tokenUpdated[] = __('Password'); } if (config_update_value('saml_path', get_parameter('saml_path'), true) === false) { $error_update[] = __('Saml path'); - } else { - $tokenUpdated[] = __('Saml path'); } if (config_update_value('saml_source', get_parameter('saml_source'), true) === false) { $error_update[] = __('Saml source'); - } else { - $tokenUpdated[] = __('Saml source'); } if (config_update_value('saml_user_id', get_parameter('saml_user_id'), true) === false) { $error_update[] = __('Saml user id parameter'); - } else { - $tokenUpdated[] = __('Saml user id parameter'); } if (config_update_value('saml_mail', get_parameter('saml_mail'), true) === false) { $error_update[] = __('Saml mail parameter'); - } else { - $tokenUpdated[] = __('Saml mail parameter'); } if (config_update_value('saml_group_name', get_parameter('saml_group_name'), true) === false) { $error_update[] = __('Saml group name parameter'); - } else { - $tokenUpdated[] = __('Saml group name parameter'); } if (config_update_value('saml_attr_type', (bool) get_parameter('saml_attr_type'), true) === false) { $error_update[] = __('Saml attr type parameter'); - } else { - $tokenUpdated[] = __('Saml attr type parameter'); } if (config_update_value('saml_profiles_and_tags', get_parameter('saml_profiles_and_tags'), true) === false) { $error_update[] = __('Saml profiles and tags parameter'); - } else { - $tokenUpdated[] = __('Saml profiles and tags parameter'); } if (config_update_value('saml_profile', get_parameter('saml_profile'), true) === false) { $error_update[] = __('Saml profile parameters'); - } else { - $tokenUpdated[] = __('Saml profile parameters'); } if (config_update_value('saml_tag', get_parameter('saml_tag'), true) === false) { $error_update[] = __('Saml tag parameter'); - } else { - $tokenUpdated[] = __('Saml tag parameter'); } if (config_update_value('saml_profile_tag_separator', get_parameter('saml_profile_tag_separator'), true) === false) { $error_update[] = __('Saml profile and tag separator'); - } else { - $tokenUpdated[] = __('Saml profile and tag separator'); } if (config_update_value('double_auth_enabled', get_parameter('double_auth_enabled'), true) === false) { $error_update[] = __('Double authentication'); - } else { - $tokenUpdated[] = __('Double authentication'); } if (config_update_value('2FA_all_users', get_parameter('2FA_all_users'), true) === false) { $error_update[] = __('2FA all users'); - } else { - $tokenUpdated[] = __('2FA all users'); } if (config_update_value('session_timeout', get_parameter('session_timeout'), true) === false) { @@ -1014,8 +752,6 @@ function config_update_config() if (config_update_value('session_timeout', 90, true) === false) { $error_update[] = __('Session timeout'); - } else { - $tokenUpdated[] = __('Session timeout'); } } } @@ -1023,12 +759,9 @@ function config_update_config() if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 0) { if (config_update_value('ad_save_password', get_parameter('ad_save_password'), true) === false) { $error_update[] = __('Save Password'); - } else { - $tokenUpdated[] = __('Save Password'); } } else if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 1) { config_update_value('ad_save_password', 1); - $tokenUpdated[] = __('Save Password'); } break; @@ -1037,186 +770,126 @@ function config_update_config() if (config_update_value('event_purge', get_parameter('event_purge'), true) === false) { $check_metaconsole_events_history = get_parameter('metaconsole_events_history', -1); $error_update[] = $check_metaconsole_events_history; - } else { - $tokenUpdated[] = __('Event purge'); } if ($check_metaconsole_events_history != -1) { if (config_update_value('metaconsole_events_history', get_parameter('metaconsole_events_history'), true) === false) { $error_update[] = __('Max. days before delete events'); - } else { - $tokenUpdated[] = __('Max. days before delete events'); } } if (config_update_value('trap_purge', get_parameter('trap_purge'), true) === false) { $error_update[] = __('Max. days before delete traps'); - } else { - $tokenUpdated[] = __('Max. days before delete traps'); } if (config_update_value('string_purge', get_parameter('string_purge'), true) === false) { $error_update[] = __('Max. days before delete string data'); - } else { - $tokenUpdated[] = __('Max. days before delete string data'); } if (config_update_value('audit_purge', get_parameter('audit_purge'), true) === false) { $error_update[] = __('Max. days before delete audit events'); - } else { - $tokenUpdated[] = __('Max. days before delete audit events'); } if (config_update_value('gis_purge', get_parameter('gis_purge'), true) === false) { $error_update[] = __('Max. days before delete GIS data'); - } else { - $tokenUpdated[] = __('Max. days before delete GIS data'); } if (config_update_value('days_purge', (int) get_parameter('days_purge'), true) === false) { $error_update[] = __('Max. days before purge'); - } else { - $tokenUpdated[] = __('Max. days before purge'); } if (config_update_value('days_delete_unknown', (int) get_parameter('days_delete_unknown'), true) === false) { $error_update[] = __('Max. days before delete unknown modules'); - } else { - $tokenUpdated[] = __('Max. days before delete unknown modules'); } if (config_update_value('days_compact', (int) get_parameter('days_compact'), true) === false) { $error_update[] = __('Max. days before compact data'); - } else { - $tokenUpdated[] = __('Max. days before compact data'); } if (config_update_value('days_autodisable_deletion', (int) get_parameter('days_autodisable_deletion'), true) === false) { $error_update[] = __('Max. days before autodisable deletion'); - } else { - $tokenUpdated[] = __('Max. days before autodisable deletion'); } if (config_update_value('report_limit', (int) get_parameter('report_limit'), true) === false) { $error_update[] = __('Item limit for realtime reports)'); - } else { - $tokenUpdated[] = __('Item limit for realtime reports)'); } if (config_update_value('step_compact', (int) get_parameter('step_compact'), true) === false) { $error_update[] = __('Compact interpolation in hours (1 Fine-20 bad)'); - } else { - $tokenUpdated[] = __('Compact interpolation in hours (1 Fine-20 bad)'); } if (config_update_value('event_view_hr', (int) get_parameter('event_view_hr'), true) === false) { $error_update[] = __('Default hours for event view'); - } else { - $tokenUpdated[] = __('Default hours for event view'); } if (config_update_value('realtimestats', get_parameter('realtimestats'), true) === false) { $error_update[] = __('Use realtime statistics'); - } else { - $tokenUpdated[] = __('Use realtime statistics'); } if (config_update_value('stats_interval', get_parameter('stats_interval'), true) === false) { $error_update[] = __('Batch statistics period (secs)'); - } else { - $tokenUpdated[] = __('Batch statistics period (secs)'); } if (config_update_value('agentaccess', (int) get_parameter('agentaccess'), true) === false) { $error_update[] = __('Use agent access graph'); - } else { - $tokenUpdated[] = __('Use agent access graph'); } if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) { $error_update[] = __('Max. recommended number of files in attachment directory'); - } else { - $tokenUpdated[] = __('Max. recommended number of files in attachment directory'); } if (config_update_value('delete_notinit', get_parameter('delete_notinit'), true) === false) { $error_update[] = __('Delete not init modules'); - } else { - $tokenUpdated[] = __('Delete not init modules'); } if (config_update_value('big_operation_step_datos_purge', get_parameter('big_operation_step_datos_purge'), true) === false) { $error_update[] = __('Big Operatiopn Step to purge old data'); - } else { - $tokenUpdated[] = __('Big Operatiopn Step to purge old data'); } if (config_update_value('small_operation_step_datos_purge', get_parameter('small_operation_step_datos_purge'), true) === false) { $error_update[] = __('Small Operation Step to purge old data'); - } else { - $tokenUpdated[] = __('Small Operation Step to purge old data'); } if (config_update_value('num_past_special_days', get_parameter('num_past_special_days'), true) === false) { $error_update[] = __('Retention period of past special days'); - } else { - $tokenUpdated[] = __('Retention period of past special days'); } if (config_update_value('max_macro_fields', get_parameter('max_macro_fields'), true) === false) { $error_update[] = __('Max. macro data fields'); - } else { - $tokenUpdated[] = __('Max. macro data fields'); } if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { if (config_update_value('inventory_purge', get_parameter('inventory_purge'), true) === false) { $error_update[] = __('Max. days before delete inventory data'); - } else { - $tokenUpdated[] = __('Max. days before delete inventory data'); } } if (config_update_value('delete_old_messages', get_parameter('delete_old_messages'), true) === false) { $error_update[] = __('Max. days before delete old messages'); - } else { - $tokenUpdated[] = __('Max. days before delete old messages'); } if (config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'), true) === false) { $error_update[] = __('Max. days before delete old network matrix data'); - } else { - $tokenUpdated[] = __('Max. days before delete old network matrix data'); } if (config_update_value('max_graph_container', get_parameter('max_graph_container'), true) === false) { $error_update[] = __('Graph container - Max. Items'); - } else { - $tokenUpdated[] = __('Graph container - Max. Items'); } if (config_update_value('max_execution_event_response', get_parameter('max_execution_event_response'), true) === false) { $error_update[] = __('Max execution event response'); - } else { - $tokenUpdated[] = __('Max execution event response'); } if (config_update_value('row_limit_csv', get_parameter('row_limit_csv'), true) === false) { $error_update[] = __('Row limit in csv log'); - } else { - $tokenUpdated[] = __('Row limit in csv log'); } if (config_update_value('snmpwalk', get_parameter('snmpwalk'), true) === false) { $error_update[] = __('SNMP walk binary path'); - } else { - $tokenUpdated[] = __('SNMP walk binary path'); } if (config_update_value('snmpwalk_fallback', get_parameter('snmpwalk_fallback'), true) === false) { $error_update[] = __('SNMP walk binary path (fallback for v1)'); - } else { - $tokenUpdated[] = __('SNMP walk binary path (fallback for v1)'); } break; @@ -1224,86 +897,58 @@ function config_update_config() // VISUAL STYLES SETUP. if (config_update_value('date_format', (string) get_parameter('date_format'), true) === false) { $error_update[] = __('Date format string'); - } else { - $tokenUpdated[] = __('Date format string'); } if (config_update_value('prominent_time', (string) get_parameter('prominent_time'), true) === false) { $error_update[] = __('Timestamp or time comparation'); - } else { - $tokenUpdated[] = __('Timestamp or time comparation'); } if (config_update_value('graph_color1', (string) get_parameter('graph_color1'), true) === false) { $error_update[] = __('Graph color #1'); - } else { - $tokenUpdated[] = __('Graph color #1'); } if (config_update_value('graph_color2', (string) get_parameter('graph_color2'), true) === false) { $error_update[] = __('Graph color #2'); - } else { - $tokenUpdated[] = __('Graph color #2'); } if (config_update_value('graph_color3', (string) get_parameter('graph_color3'), true) === false) { $error_update[] = __('Graph color #3'); - } else { - $tokenUpdated[] = __('Graph color #3'); } if (config_update_value('graph_color4', (string) get_parameter('graph_color4'), true) === false) { $error_update[] = __('Graph color #4'); - } else { - $tokenUpdated[] = __('Graph color #4'); } if (config_update_value('graph_color5', (string) get_parameter('graph_color5'), true) === false) { $error_update[] = __('Graph color #5'); - } else { - $tokenUpdated[] = __('Graph color #5'); } if (config_update_value('graph_color6', (string) get_parameter('graph_color6'), true) === false) { $error_update[] = __('Graph color #6'); - } else { - $tokenUpdated[] = __('Graph color #6'); } if (config_update_value('graph_color7', (string) get_parameter('graph_color7'), true) === false) { $error_update[] = __('Graph color #7'); - } else { - $tokenUpdated[] = __('Graph color #7'); } if (config_update_value('graph_color8', (string) get_parameter('graph_color8'), true) === false) { $error_update[] = __('Graph color #8'); - } else { - $tokenUpdated[] = __('Graph color #8'); } if (config_update_value('graph_color9', (string) get_parameter('graph_color9'), true) === false) { $error_update[] = __('Graph color #9'); - } else { - $tokenUpdated[] = __('Graph color #9'); } if (config_update_value('graph_color10', (string) get_parameter('graph_color10'), true) === false) { $error_update[] = __('Graph color #10'); - } else { - $tokenUpdated[] = __('Graph color #10'); } if (config_update_value('interface_unit', (string) get_parameter('interface_unit', __('Bytes')), true) === false) { $error_update[] = __('Value to interface graphics'); - } else { - $tokenUpdated[] = __('Value to interface graphics'); } if (config_update_value('graph_precision', (string) get_parameter('graph_precision', 1), true) === false) { $error_update[] = __('Data precision for reports'); - } else { - $tokenUpdated[] = __('Data precision for reports'); } $style = (string) get_parameter('style'); @@ -1313,466 +958,312 @@ function config_update_config() if (config_update_value('style', $style, true) === false) { $error_update[] = __('Style template'); - } else { - $tokenUpdated[] = __('Style template'); } if (config_update_value('block_size', (int) get_parameter('block_size'), true) === false) { $error_update[] = __('Block size for pagination'); - } else { - $tokenUpdated[] = __('Block size for pagination'); } if (config_update_value('round_corner', (bool) get_parameter('round_corner'), true) === false) { $error_update[] = __('Use round corners'); - } else { - $tokenUpdated[] = __('Use round corners'); } if (config_update_value('maximum_y_axis', (bool) get_parameter('maximum_y_axis'), true) === false) { $error_update[] = __('Chart fit to content'); - } else { - $tokenUpdated[] = __('Chart fit to content'); } if (config_update_value('show_qr_code_header', (bool) get_parameter('show_qr_code_header'), true) === false) { $error_update[] = __('Show QR code header'); - } else { - $tokenUpdated[] = __('Show QR code header'); } if (config_update_value('status_images_set', (string) get_parameter('status_images_set'), true) === false) { $error_update[] = __('Status icon set'); - } else { - $tokenUpdated[] = __('Status icon set'); } if (config_update_value('fontpath', (string) get_parameter('fontpath'), true) === false) { $error_update[] = __('Font path'); - } else { - $tokenUpdated[] = __('Font path'); } if (config_update_value('font_size', get_parameter('font_size'), true) === false) { $error_update[] = __('Font size'); - } else { - $tokenUpdated[] = __('Font size'); } if (config_update_value('custom_favicon', (string) get_parameter('custom_favicon'), true) === false) { $error_update[] = __('Custom favicon'); - } else { - $tokenUpdated[] = __('Custom favicon'); } if (config_update_value('custom_logo', (string) get_parameter('custom_logo'), true) === false) { $error_update[] = __('Custom logo'); - } else { - $tokenUpdated[] = __('Custom logo'); } if (config_update_value('custom_logo_collapsed', (string) get_parameter('custom_logo_collapsed'), true) === false) { $error_update[] = __('Custom logo collapsed'); - } else { - $tokenUpdated[] = __('Custom logo collapsed'); } if (config_update_value('custom_logo_white_bg', (string) get_parameter('custom_logo_white_bg'), true) === false) { $error_update[] = __('Custom logo white background'); - } else { - $tokenUpdated[] = __('Custom logo white background'); } if (config_update_value('custom_logo_login', (string) get_parameter('custom_logo_login'), true) === false) { $error_update[] = __('Custom logo login'); - } else { - $tokenUpdated[] = __('Custom logo login'); } if (config_update_value('custom_splash_login', (string) get_parameter('custom_splash_login'), true) === false) { $error_update[] = __('Custom splash login'); - } else { - $tokenUpdated[] = __('Custom splash login'); } if (config_update_value('custom_docs_logo', (string) get_parameter('custom_docs_logo'), true) === false) { $error_update[] = __('Custom documentation logo'); - } else { - $tokenUpdated[] = __('Custom documentation logo'); } if (config_update_value('custom_support_logo', (string) get_parameter('custom_support_logo'), true) === false) { $error_update[] = __('Custom support logo'); - } else { - $tokenUpdated[] = __('Custom support logo'); } if (config_update_value('custom_network_center_logo', (string) get_parameter('custom_network_center_logo'), true) === false) { $error_update[] = __('Custom networkmap center logo'); - } else { - $tokenUpdated[] = __('Custom networkmap center logo'); } if (config_update_value('custom_mobile_console_logo', (string) get_parameter('custom_mobile_console_logo'), true) === false) { $error_update[] = __('Custom networkmap center logo'); - } else { - $tokenUpdated[] = __('Custom networkmap center logo'); } if (config_update_value('custom_title_header', (string) get_parameter('custom_title_header'), true) === false) { $error_update[] = __('Custom title header'); - } else { - $tokenUpdated[] = __('Custom title header'); } if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) { $error_update[] = __('Custom subtitle header'); - } else { - $tokenUpdated[] = __('Custom subtitle header'); } if (config_update_value('meta_custom_title_header', (string) get_parameter('meta_custom_title_header'), true) === false) { $error_update[] = __('Meta custom title header'); - } else { - $tokenUpdated[] = __('Meta custom title header'); } if (config_update_value('meta_custom_subtitle_header', (string) get_parameter('meta_custom_subtitle_header'), true) === false) { $error_update[] = __('Meta custom subtitle header'); - } else { - $tokenUpdated[] = __('Meta custom subtitle header'); } if (config_update_value('custom_title1_login', (string) get_parameter('custom_title1_login'), true) === false) { $error_update[] = __('Custom title1 login'); - } else { - $tokenUpdated[] = __('Custom title1 login'); } if (config_update_value('custom_title2_login', (string) get_parameter('custom_title2_login'), true) === false) { $error_update[] = __('Custom title2 login'); - } else { - $tokenUpdated[] = __('Custom title2 login'); } if (config_update_value('login_background', (string) get_parameter('login_background'), true) === false) { $error_update[] = __('Login background'); - } else { - $tokenUpdated[] = __('Login background'); } if (config_update_value('custom_docs_url', (string) get_parameter('custom_docs_url'), true) === false) { $error_update[] = __('Custom Docs url'); - } else { - $tokenUpdated[] = __('Custom Docs url'); } if (config_update_value('custom_support_url', (string) get_parameter('custom_support_url'), true) === false) { $error_update[] = __('Custom support url'); - } else { - $tokenUpdated[] = __('Custom support url'); } if (config_update_value('rb_product_name', (string) get_parameter('rb_product_name'), true) === false) { $error_update[] = __('Product name'); - } else { - $tokenUpdated[] = __('Product name'); } if (config_update_value('rb_copyright_notice', (string) get_parameter('rb_copyright_notice'), true) === false) { $error_update[] = __('Copyright notice'); - } else { - $tokenUpdated[] = __('Copyright notice'); } if (config_update_value('meta_custom_logo_white_bg', (string) get_parameter('meta_custom_logo_white_bg'), true) === false) { $error_update[] = __('Custom logo metaconsole (white background)'); - } else { - $tokenUpdated[] = __('Custom logo metaconsole (white background)'); } if (config_update_value('meta_custom_logo_login', (string) get_parameter('meta_custom_logo_login'), true) === false) { $error_update[] = __('Custom logo login metaconsole'); - } else { - $tokenUpdated[] = __('Custom logo login metaconsole'); } if (config_update_value('meta_custom_splash_login', (string) get_parameter('meta_custom_splash_login'), true) === false) { $error_update[] = __('Custom splash login metaconsole'); - } else { - $tokenUpdated[] = __('Custom splash login metaconsole'); } if (config_update_value('meta_custom_title1_login', (string) get_parameter('meta_custom_title1_login'), true) === false) { $error_update[] = __('Custom title1 login metaconsole'); - } else { - $tokenUpdated[] = __('Custom title1 login metaconsole'); } if (config_update_value('meta_custom_title2_login', (string) get_parameter('meta_custom_title2_login'), true) === false) { $error_update[] = __('Custom title2 login metaconsole'); - } else { - $tokenUpdated[] = __('Custom title2 login metaconsole'); } if (config_update_value('meta_login_background', (string) get_parameter('meta_login_background'), true) === false) { $error_update[] = __('Login background metaconsole'); - } else { - $tokenUpdated[] = __('Login background metaconsole'); } if (config_update_value('meta_custom_docs_url', (string) get_parameter('meta_custom_docs_url'), true) === false) { $error_update[] = __('Custom Docs url'); - } else { - $tokenUpdated[] = __('Custom Docs url'); } if (config_update_value('meta_custom_support_url', (string) get_parameter('meta_custom_support_url'), true) === false) { $error_update[] = __('Custom support url'); - } else { - $tokenUpdated[] = __('Custom support url'); } if (config_update_value('legacy_vc', (int) get_parameter('legacy_vc'), true) === false) { $error_update[] = __('Use the legacy Visual Console'); - } else { - $tokenUpdated[] = __('Use the legacy Visual Console'); } if (config_update_value('vc_default_cache_expiration', (int) get_parameter('vc_default_cache_expiration'), true) === false) { $error_update[] = __("Default expiration of the Visual Console item's cache"); - } else { - $tokenUpdated[] = __("Default expiration of the Visual Console item's cache"); } if (config_update_value('vc_refr', (int) get_parameter('vc_refr'), true) === false) { $error_update[] = __('Default interval for refresh on Visual Console'); - } else { - $tokenUpdated[] = __('Default interval for refresh on Visual Console'); } if (config_update_value('vc_favourite_view', (int) get_parameter('vc_favourite_view', 0), true) === false) { $error_update[] = __('Default line favourite_view for the Visual Console'); - } else { - $tokenUpdated[] = __('Default line favourite_view for the Visual Console'); } if (config_update_value('vc_menu_items', (int) get_parameter('vc_menu_items', 10), true) === false) { $error_update[] = __('Default line menu items for the Visual Console'); - } else { - $tokenUpdated[] = __('Default line menu items for the Visual Console'); } if (config_update_value('vc_line_thickness', (int) get_parameter('vc_line_thickness'), true) === false) { $error_update[] = __('Default line thickness for the Visual Console'); - } else { - $tokenUpdated[] = __('Default line thickness for the Visual Console'); } if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) { $error_update[] = __('Default line menu items for the Services'); - } else { - $tokenUpdated[] = __('Default line menu items for the Services'); } if (config_update_value('agent_size_text_small', get_parameter('agent_size_text_small'), true) === false) { $error_update[] = __('Agent size text'); - } else { - $tokenUpdated[] = __('Agent size text'); } if (config_update_value('agent_size_text_medium', get_parameter('agent_size_text_medium'), true) === false) { $error_update[] = __('Agent size text'); - } else { - $tokenUpdated[] = __('Agent size text'); } if (config_update_value('module_size_text_small', get_parameter('module_size_text_small'), true) === false) { $error_update[] = __('Module size text'); - } else { - $tokenUpdated[] = __('Module size text'); } if (config_update_value('module_size_text_medium', get_parameter('module_size_text_medium'), true) === false) { $error_update[] = __('Description size text'); - } else { - $tokenUpdated[] = __('Description size text'); } if (config_update_value('description_size_text', get_parameter('description_size_text'), true) === false) { $error_update[] = __('Description size text'); - } else { - $tokenUpdated[] = __('Description size text'); } if (config_update_value('item_title_size_text', get_parameter('item_title_size_text'), true) === false) { $error_update[] = __('Item title size text'); - } else { - $tokenUpdated[] = __('Item title size text'); } if (config_update_value('gis_label', get_parameter('gis_label'), true) === false) { $error_update[] = __('GIS Labels'); - } else { - $tokenUpdated[] = __('GIS Labels'); } if (config_update_value('simple_module_value', get_parameter('simple_module_value'), true) === false) { $error_update[] = __('Show units in values report'); - } else { - $tokenUpdated[] = __('Show units in values report'); } if (config_update_value('gis_default_icon', get_parameter('gis_default_icon'), true) === false) { $error_update[] = __('Default icon in GIS'); - } else { - $tokenUpdated[] = __('Default icon in GIS'); } if (config_update_value('autohidden_menu', get_parameter('autohidden_menu'), true) === false) { $error_update[] = __('Autohidden menu'); - } else { - $tokenUpdated[] = __('Autohidden menu'); } if (config_update_value('visual_animation', get_parameter('visual_animation'), true) === false) { $error_update[] = __('visual_animation'); - } else { - $tokenUpdated[] = __('visual_animation'); } if (config_update_value('disable_help', get_parameter('disable_help'), true) === false) { $error_update[] = __('Disable help'); - } else { - $tokenUpdated[] = __('Disable help'); } if (config_update_value('fixed_graph', get_parameter('fixed_graph'), true) === false) { $error_update[] = __('Fixed graph'); - } else { - $tokenUpdated[] = __('Fixed graph'); } if (config_update_value('fixed_header', get_parameter('fixed_header'), true) === false) { $error_update[] = __('Fixed header'); - } else { - $tokenUpdated[] = __('Fixed header'); } if (config_update_value('paginate_module', get_parameter('paginate_module'), true) === false) { $error_update[] = __('Paginate module'); - } else { - $tokenUpdated[] = __('Paginate module'); } if (config_update_value('graphviz_bin_dir', get_parameter('graphviz_bin_dir'), true) === false) { $error_update[] = __('Custom graphviz directory'); - } else { - $tokenUpdated[] = __('Custom graphviz directory'); } if (config_update_value('networkmap_max_width', get_parameter('networkmap_max_width'), true) === false) { $error_update[] = __('Networkmap max width'); - } else { - $tokenUpdated[] = __('Networkmap max width'); } if (config_update_value('short_module_graph_data', get_parameter('short_module_graph_data'), true) === false) { $error_update[] = __('Shortened module graph data'); - } else { - $tokenUpdated[] = __('Shortened module graph data'); } if (config_update_value('show_group_name', get_parameter('show_group_name'), true) === false) { $error_update[] = __('Show the group name instead the group icon.'); - } else { - $tokenUpdated[] = __('Show the group name instead the group icon.'); } if (config_update_value('custom_graph_width', (int) get_parameter('custom_graph_width', 1), true) === false) { $error_update[] = __('Default line thickness for the Custom Graph.'); - } else { - $tokenUpdated[] = __('Default line thickness for the Custom Graph.'); } if (config_update_value('type_module_charts', (string) get_parameter('type_module_charts', 'area'), true) === false) { $error_update[] = __('Default type of module charts.'); - } else { - $tokenUpdated[] = __('Default type of module charts.'); } if (config_update_value('items_combined_charts', (string) get_parameter('items_combined_charts', 10), true) === false) { $error_update[] = __('Default Number of elements in Custom Graph.'); - } else { - $tokenUpdated[] = __('Default Number of elements in Custom Graph.'); } if (config_update_value('type_interface_charts', (string) get_parameter('type_interface_charts', 'line'), true) === false) { $error_update[] = __('Default type of interface charts.'); - } else { - $tokenUpdated[] = __('Default type of interface charts.'); } if (config_update_value('render_proc', (bool) get_parameter('render_proc', false), true) === false) { $error_update[] = __('Display data of proc modules in other format'); - } else { - $tokenUpdated[] = __('Display data of proc modules in other format'); } if (config_update_value('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok')), true) === false) { $error_update[] = __('Display text proc modules have state is ok'); - } else { - $tokenUpdated[] = __('Display text proc modules have state is ok'); } if (config_update_value('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail')), true) === false) { $error_update[] = __('Display text when proc modules have state critical'); - } else { - $tokenUpdated[] = __('Display text when proc modules have state critical'); } if (config_update_value('click_display', (bool) get_parameter('click_display', false), true) === false) { $error_update[] = __('Display lateral menus with left click'); - } else { - $tokenUpdated[] = __('Display lateral menus with left click'); } if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { if (config_update_value('service_label_font_size', get_parameter('service_label_font_size', false), true) === false) { $error_update[] = __('Service label font size'); - } else { - $tokenUpdated[] = __('Service label font size'); } if (config_update_value('service_item_padding_size', get_parameter('service_item_padding_size', false), true) === false) { $error_update[] = __('Service item padding size'); - } else { - $tokenUpdated[] = __('Service item padding size'); } } if (config_update_value('percentil', (int) get_parameter('percentil', 0), true) === false) { $error_update[] = __('Default percentil'); - } else { - $tokenUpdated[] = __('Default percentil'); } if (config_update_value('full_scale_option', (int) get_parameter('full_scale_option', 0), true) === false) { $error_update[] = __('Default full scale (TIP)'); - } else { - $tokenUpdated[] = __('Default full scale (TIP)'); } if (config_update_value('type_mode_graph', (int) get_parameter('type_mode_graph', 0), true) === false) { $error_update[] = __('Default soft graphs'); - } else { - $tokenUpdated[] = __('Default soft graphs'); } if (config_update_value('zoom_graph', (int) get_parameter('zoom_graph', 1), true) === false) { $error_update[] = __('Default zoom graphs'); - } else { - $tokenUpdated[] = __('Default zoom graphs'); } if (config_update_value( @@ -1783,8 +1274,6 @@ function config_update_config() $error_update[] = __( 'Default height of the chart image' ); - } else { - $tokenUpdated[] = __('Default height of the chart image'); } // -------------------------------------------------- @@ -1806,8 +1295,6 @@ function config_update_config() ) === false ) { $error_update[] = __('Add the custom post process'); - } else { - $tokenUpdated[] = __('Add the custom post process'); } } @@ -1858,8 +1345,6 @@ function config_update_config() if (config_update_value('interval_values', $interval_values, true) === false) { $error_update[] = __('Delete interval'); - } else { - $tokenUpdated[] = __('Delete interval'); } // -------------------------------------------------- @@ -1872,171 +1357,117 @@ function config_update_config() if (empty($custom_unit) === false) { if (add_custom_module_unit($custom_unit) === false) { $error_update[] = __('Add custom module unit'); - } else { - $tokenUpdated[] = __('Add custom module unit'); } } if (empty($custom_unit_to_delete) === false) { if (delete_custom_module_unit($custom_unit_to_delete) === false) { $error_update[] = __('Delete custom module unit'); - } else { - $tokenUpdated[] = __('Delete custom module unit'); } } if (config_update_value('custom_report_info', get_parameter('custom_report_info'), true) === false) { $error_update[] = __('Custom report info'); - } else { - $tokenUpdated[] = __('Custom report info'); } if (config_update_value('font_size_item_report', get_parameter('font_size_item_report', 2), true) === false) { $error_update[] = __('HTML font size for SLA (em)'); - } else { - $tokenUpdated[] = __('HTML font size for SLA (em)'); } if (config_update_value('global_font_size_report', get_parameter('global_font_size_report', 10), true) === false) { $error_update[] = __('PDF font size (px)'); - } else { - $tokenUpdated[] = __('PDF font size (px)'); } if (config_update_value('custom_report_front', get_parameter('custom_report_front'), true) === false) { $error_update[] = __('Custom report front'); - } else { - $tokenUpdated[] = __('Custom report front'); } if (config_update_value('custom_report_front_font', get_parameter('custom_report_front_font'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Font family'); - } else { - $tokenUpdated[] = __('Custom report front').' - '.__('Font family'); } if (config_update_value('custom_report_front_logo', get_parameter('custom_report_front_logo'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Custom logo'); - } else { - $tokenUpdated[] = __('Custom report front').' - '.__('Custom logo'); } if (config_update_value('custom_report_front_header', get_parameter('custom_report_front_header'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Header'); - } else { - $tokenUpdated[] = __('Custom report front').' - '.__('Header'); } if (config_update_value('custom_report_front_firstpage', get_parameter('custom_report_front_firstpage'), true) === false) { $error_update[] = __('Custom report front').' - '.__('First page'); - } else { - $tokenUpdated[] = __('Custom report front').' - '.__('First page'); } if (config_update_value('custom_report_front_footer', get_parameter('custom_report_front_footer'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Footer'); - } else { - $tokenUpdated[] = __('Custom report front').' - '.__('Footer'); } if (config_update_value('csv_divider', (string) get_parameter('csv_divider', ';'), true) === false) { $error_update[] = __('CSV divider'); - } else { - $tokenUpdated[] = __('CSV divider'); } if (config_update_value('csv_decimal_separator', (string) get_parameter('csv_decimal_separator', '.'), true) === false) { $error_update[] = __('CSV decimal separator'); - } else { - $tokenUpdated[] = __('CSV decimal separator'); } if (config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'), true) === false) { $error_update[] = __('Use data multiplier'); - } else { - $tokenUpdated[] = __('Use data multiplier'); } break; case 'net': if (config_update_value('netflow_path', get_parameter('netflow_path'), true) === false) { $error_update[] = __('Data storage path'); - } else { - $tokenUpdated[] = __('Data storage path'); } if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) { $error_update[] = __('Daemon interval'); - } else { - $tokenUpdated[] = __('Daemon interval'); } if (config_update_value('netflow_daemon', get_parameter('netflow_daemon'), true) === false) { $error_update[] = __('Daemon binary path'); - } else { - $tokenUpdated[] = __('Daemon binary path'); } if (config_update_value('netflow_nfdump', get_parameter('netflow_nfdump'), true) === false) { $error_update[] = __('Nfdump binary path'); - } else { - $tokenUpdated[] = __('Nfdump binary path'); } if (config_update_value('netflow_nfexpire', get_parameter('netflow_nfexpire'), true) === false) { $error_update[] = __('Nfexpire binary path'); - } else { - $tokenUpdated[] = __('Nfexpire binary path'); } if (config_update_value('netflow_max_resolution', (int) get_parameter('netflow_max_resolution'), true) === false) { $error_update[] = __('Maximum chart resolution'); - } else { - $tokenUpdated[] = __('Maximum chart resolution'); } if (config_update_value('netflow_disable_custom_lvfilters', get_parameter('netflow_disable_custom_lvfilters'), true) === false) { $error_update[] = __('Disable custom live view filters'); - } else { - $tokenUpdated[] = __('Disable custom live view filters'); } if (config_update_value('netflow_max_lifetime', (int) get_parameter('netflow_max_lifetime'), true) === false) { $error_update[] = __('Netflow max lifetime'); - } else { - $tokenUpdated[] = __('Netflow max lifetime'); } if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) { $error_update[] = __('Name resolution for IP address'); - } else { - $tokenUpdated[] = __('Name resolution for IP address'); } break; case 'log': if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) { $error_update[] = __('IP ElasticSearch server'); - } else { - $tokenUpdated[] = __('IP ElasticSearch server'); } if (config_update_value('elasticsearch_port', get_parameter('elasticsearch_port'), true) === false) { $error_update[] = __('Port ElasticSearch server'); - } else { - $tokenUpdated[] = __('Port ElasticSearch server'); } if (config_update_value('number_logs_viewed', (int) get_parameter('number_logs_viewed'), true) === false) { $error_update[] = __('Number of logs viewed'); - } else { - $tokenUpdated[] = __('Number of logs viewed'); } if (config_update_value('Days_purge_old_information', (int) get_parameter('Days_purge_old_information'), true) === false) { $error_update[] = __('Days to purge old information'); - } else { - $tokenUpdated[] = __('Days to purge old information'); } break; @@ -2055,45 +1486,31 @@ function config_update_config() } else { if (config_update_value('history_db_host', get_parameter('history_db_host'), true) === false) { $error_update[] = __('Host'); - } else { - $tokenUpdated[] = __('Host'); } if (config_update_value('history_db_port', get_parameter('history_db_port'), true) === false) { $error_update[] = __('Port'); - } else { - $tokenUpdated[] = __('Port'); } if (config_update_value('history_db_name', get_parameter('history_db_name'), true) === false) { $error_update[] = __('Database name'); - } else { - $tokenUpdated[] = __('Database name'); } } if (config_update_value('history_db_enabled', get_parameter('history_db_enabled'), true) === false) { $error_update[] = __('Enable history database'); - } else { - $tokenUpdated[] = __('Enable history database'); } if (config_update_value('history_event_enabled', get_parameter('history_event_enabled'), true) === false) { $error_update[] = __('Enable history event'); - } else { - $tokenUpdated[] = __('Enable history event'); } if (config_update_value('history_db_user', get_parameter('history_db_user'), true) === false) { $error_update[] = __('Database user'); - } else { - $tokenUpdated[] = __('Database user'); } if (config_update_value('history_db_pass', io_input_password(get_parameter('history_db_pass')), true) === false) { $error_update[] = __('Database password'); - } else { - $tokenUpdated[] = __('Database password'); } $history_db_days = get_parameter('history_db_days'); @@ -2102,8 +1519,6 @@ function config_update_config() || config_update_value('history_db_days', $history_db_days) === false ) { $error_update[] = __('Days'); - } else { - $tokenUpdated[] = __('Days'); } $history_event_days = get_parameter('history_event_days'); @@ -2112,8 +1527,6 @@ function config_update_config() || config_update_value('history_event_days', $history_event_days) === false ) { $error_update[] = __('Event Days'); - } else { - $tokenUpdated[] = __('Event Days'); } $history_db_step = get_parameter('history_db_step'); @@ -2122,8 +1535,6 @@ function config_update_config() || !config_update_value('history_db_step', $history_db_step) ) { $error_update[] = __('Step'); - } else { - $tokenUpdated[] = __('Step'); } $history_db_delay = get_parameter('history_db_delay'); @@ -2132,8 +1543,6 @@ function config_update_config() || !config_update_value('history_db_delay', $history_db_delay) ) { $error_update[] = __('Delay'); - } else { - $tokenUpdated[] = __('Delay'); } if ((bool) $config['history_db_enabled'] === true) { @@ -2202,76 +1611,52 @@ function config_update_config() case 'ehorus': if (config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0), true) === false) { $error_update[] = __('Enable eHorus'); - } else { - $tokenUpdated[] = __('Enable eHorus'); } if (config_update_value('ehorus_user_level_conf', (int) get_parameter('ehorus_user_level_conf', 0), true) === false) { $error_update[] = __('eHorus user login'); - } else { - $tokenUpdated[] = __('eHorus user login'); } if (config_update_value('ehorus_user', (string) get_parameter('ehorus_user', $config['ehorus_user']), true) === false) { $error_update[] = __('eHorus user'); - } else { - $tokenUpdated[] = __('eHorus user'); } if (config_update_value('ehorus_pass', io_input_password((string) get_parameter('ehorus_pass', $config['ehorus_pass'])), true) === false) { $error_update[] = __('eHorus password'); - } else { - $tokenUpdated[] = __('eHorus password'); } if (config_update_value('ehorus_hostname', (string) get_parameter('ehorus_hostname', $config['ehorus_hostname']), true) === false) { $error_update[] = __('eHorus API hostname'); - } else { - $tokenUpdated[] = __('eHorus API hostname'); } if (config_update_value('ehorus_port', (int) get_parameter('ehorus_port', $config['ehorus_port']), true) === false) { $error_update[] = __('eHorus API port'); - } else { - $tokenUpdated[] = __('eHorus API port'); } if (config_update_value('ehorus_req_timeout', (int) get_parameter('ehorus_req_timeout', $config['ehorus_req_timeout']), true) === false) { $error_update[] = __('eHorus request timeout'); - } else { - $tokenUpdated[] = __('eHorus request timeout'); } if (config_update_value('ehorus_custom_field', (string) get_parameter('ehorus_custom_field', $config['ehorus_custom_field']), true) === false) { $error_update[] = __('eHorus id custom field'); - } else { - $tokenUpdated[] = __('eHorus id custom field'); } break; case 'integria': if (config_update_value('integria_user_level_conf', (int) get_parameter('integria_user_level_conf', 0), true) === false) { $error_update[] = __('Integria user login'); - } else { - $tokenUpdated[] = __('Integria user login'); } if (config_update_value('integria_enabled', (int) get_parameter('integria_enabled', 0), true) === false) { $error_update[] = __('Enable Integria IMS'); - } else { - $tokenUpdated[] = __('Enable Integria IMS'); } if (config_update_value('integria_user', (string) get_parameter('integria_user', $config['integria_user']), true) === false) { $error_update[] = __('Integria user'); - } else { - $tokenUpdated[] = __('Integria user'); } if (config_update_value('integria_pass', io_input_password((string) get_parameter('integria_pass', $config['integria_pass'])), true) === false) { $error_update[] = __('Integria password'); - } else { - $tokenUpdated[] = __('Integria password'); } $integria_hostname = (string) get_parameter('integria_hostname', $config['integria_hostname']); @@ -2286,146 +1671,98 @@ function config_update_config() if (config_update_value('integria_hostname', $integria_hostname, true) === false) { $error_update[] = __('integria API hostname'); - } else { - $tokenUpdated[] = __('integria API hostname'); } if (config_update_value('integria_api_pass', io_input_password((string) get_parameter('integria_api_pass', $config['integria_api_pass'])), true) === false) { $error_update[] = __('Integria API password'); - } else { - $tokenUpdated[] = __('Integria API password'); } if (config_update_value('integria_req_timeout', (int) get_parameter('integria_req_timeout', $config['integria_req_timeout']), true) === false) { $error_update[] = __('Integria request timeout'); - } else { - $tokenUpdated[] = __('Integria request timeout'); } if (config_update_value('default_group', (int) get_parameter('default_group', $config['default_group']), true) === false) { $error_update[] = __('Integria default group'); - } else { - $tokenUpdated[] = __('Integria default group'); } if (config_update_value('cr_default_group', (int) get_parameter('cr_default_group', $config['cr_default_group']), true) === false) { $error_update[] = __('Integria custom response default group'); - } else { - $tokenUpdated[] = __('Integria custom response default group'); } if (config_update_value('default_criticity', (int) get_parameter('default_criticity', $config['default_criticity']), true) === false) { $error_update[] = __('Integria default priority'); - } else { - $tokenUpdated[] = __('Integria default priority'); } if (config_update_value('cr_default_criticity', (int) get_parameter('cr_default_criticity', $config['cr_default_criticity']), true) === false) { $error_update[] = __('Integria custom response default priority'); - } else { - $tokenUpdated[] = __('Integria custom response default priority'); } if (config_update_value('default_creator', (string) get_parameter('default_creator', $config['default_creator']), true) === false) { $error_update[] = __('Integria default creator'); - } else { - $tokenUpdated[] = __('Integria default creator'); } if (config_update_value('default_owner', (string) get_parameter('default_owner', $config['default_owner']), true) === false) { $error_update[] = __('Integria default owner'); - } else { - $tokenUpdated[] = __('Integria default owner'); } if (config_update_value('cr_default_owner', (string) get_parameter('cr_default_owner', $config['cr_default_owner']), true) === false) { $error_update[] = __('Integria custom response default owner'); - } else { - $tokenUpdated[] = __('Integria custom response default owner'); } if (config_update_value('incident_type', (int) get_parameter('incident_type', $config['incident_type']), true) === false) { $error_update[] = __('Integria default ticket type'); - } else { - $tokenUpdated[] = __('Integria default ticket type'); } if (config_update_value('cr_incident_type', (int) get_parameter('cr_incident_type', $config['cr_incident_type']), true) === false) { $error_update[] = __('Integria custom response default ticket type'); - } else { - $tokenUpdated[] = __('Integria custom response default ticket type'); } if (config_update_value('incident_status', (int) get_parameter('incident_status', $config['incident_status']), true) === false) { $error_update[] = __('Integria default ticket status'); - } else { - $tokenUpdated[] = __('Integria default ticket status'); } if (config_update_value('cr_incident_status', (int) get_parameter('cr_incident_status', $config['cr_incident_status']), true) === false) { $error_update[] = __('Integria custom response default ticket status'); - } else { - $tokenUpdated[] = __('Integria custom response default ticket status'); } if (config_update_value('incident_title', (string) get_parameter('incident_title', $config['incident_title']), true) === false) { $error_update[] = __('Integria default ticket title'); - } else { - $tokenUpdated[] = __('Integria default ticket title'); } if (config_update_value('cr_incident_title', (string) get_parameter('cr_incident_title', $config['cr_incident_title']), true) === false) { $error_update[] = __('Integria custom response default ticket title'); - } else { - $tokenUpdated[] = __('Integria custom response default ticket title'); } if (config_update_value('incident_content', (string) get_parameter('incident_content', $config['incident_content']), true) === false) { $error_update[] = __('Integria default ticket content'); - } else { - $tokenUpdated[] = __('Integria default ticket content'); } if (config_update_value('cr_incident_content', (string) get_parameter('cr_incident_content', $config['cr_incident_content']), true) === false) { $error_update[] = __('Integria custom response default ticket content'); - } else { - $tokenUpdated[] = __('Integria custom response default ticket content'); } break; case 'module_library': - $module_library_user = get_parameter('module_library_user'); - if (config_update_value('module_library_user', $module_library_user, true) === false) { - $error_update[] = __('User'); - } else { - $tokenUpdated[] = __('User'); + if (config_update_value('module_library_user', get_parameter('module_library_user'), true) === false) { + $error_update[] = __('Module Library User'); } - $module_library_password = get_parameter('module_library_password'); - if (config_update_value('module_library_password', $module_library_password, true) === false) { - $error_update[] = __('Password'); - } else { - $tokenUpdated[] = __('Password'); + if (config_update_value('module_library_password', get_parameter('module_library_password'), true) === false) { + $error_update[] = __('Module Library Password'); } break; case 'websocket_engine': if (config_update_value('ws_bind_address', get_parameter('ws_bind_address'), true) === false) { $error_update[] = __('WebSocket bind address'); - } else { - $tokenUpdated[] = __('WebSocket bind address'); } if (config_update_value('ws_port', get_parameter('ws_port'), true) === false) { $error_update[] = __('WebSocket port'); - } else { - $tokenUpdated[] = __('WebSocket port'); } if (config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'), true) === false) { $error_update[] = __('WebSocket proxy url'); - } else { - $tokenUpdated[] = __('WebSocket proxy url'); } break; @@ -2442,27 +1779,26 @@ function config_update_config() if (count($error_update) > 0) { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = false; - $values = implode(', ', $error_update); - $config['error_config_update_config']['message'] = sprintf(__('Failed updated: the next values cannot update: %s'), $values); + $values = implode('
-', $error_update); + $config['error_config_update_config']['message'] = sprintf( + __('Failed updated: the next values cannot update:
-%s'), + $values + ); db_pandora_audit( AUDIT_LOG_SETUP, 'Failed changing Setup', false, false, - sprintf('The next values cannot update: %s', $values) + $config['error_config_update_config']['message'] ); } else { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = true; - $values = implode(', ', $tokenUpdated); db_pandora_audit( AUDIT_LOG_SETUP, - 'Setup has changed', - false, - false, - sprintf('the next tokens has been updated: %s', $values) + 'Setup has changed' ); }