diff --git a/CHANGELOG b/CHANGELOG index 65de6efa28..eb2a294cba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,34 @@ Cacti CHANGELOG -issue#5184: Cacti permission checks generate SQL errors is the user has been deleted -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: Getting SQL errors in the Cacti due to plugin calling register function in wrong location +-issue#5188: Device Template Filter broken +-issue#5190: When using Gradient Support GPRINT Text Format is misaligned +-issue#5194: CSRF directory needs to be writeable for creating the csrf-secret.php file +-issue#5195: Spikekill Backtrace Argument #1 ($string) must be passed by reference, value given +-issue#5196: Gradient support breaks certain Graphs with special characters in them +-issue#5197: Realtime graph on remote poller not working in 1.2.23 +-issue#5198: PHP Diff Renderer throws warnings +-issue#5199: When trying to obtain data, cacti should not log Transport Read errors +-issue#5200: Cacti function throws errors when attempting to render classic images in PHP8 +-issue#5201: Minor issues in modern and dark prevent weathermaps from rendering correctly +-issue#5202: When importing packages, Graph Size does not get updated to Graph Templates +-issue#5203: Scripts ss_net_snmp_device_io.php and ss_net_snmp_device_bytes.php break when using HMIB plugin and PHP8.1 +-issue#5204: Compatibility improvements for Audit Database under PHP 8.x +-issue#5205: When using Diff Viewer, rendering is not always correct under certain themes +-issue#5207: Compatibility improvements for Installer under PHP 8.x +-issue#5208: Package form objects use the wrong text domain in their i18n strings +-issue#5211: Undefined variable $user_id when creating new graph +-issue#5214: Basic Auth is timing out and logging users off automatically +-issue#5223: When using callback form functions, name and id field may not be correctly set +-issue#5224: When poller runtime is exceeded, time should be display as a rounded number +-issue#5227: When debugging a data source, errors may be shown if no RRDfile created yet +-issue#5232: On large systems statistics gathering at the beginning of a poller run lead to excessive polling times +-issue#5236: Edit Graph Template link missing base_url +-issue#5238: Searching for Poller Items Generates SQL Errors +-issue#5239: SNMP-Options - Bulk Walk Maximum Repetitions ignored +-issue#5241: "Balance Process Load" dont work after upgrade to 1.2.23 +-issue#5243: Template Export missing Graph Template columns multiple and test_source +-issue#5247: Rebuilding Poller Cache from Utilities does not respect poller interval due to lack or ordering 1.2.23 -security#4920: Add .htaccess file to scripts folder diff --git a/automation_snmp.php b/automation_snmp.php index 8bdbade826..4759b57c18 100644 --- a/automation_snmp.php +++ b/automation_snmp.php @@ -132,23 +132,25 @@ function form_automation_snmp_save() { get_filter_request_var('id'); /* ==================================================== */ - $save = array(); - $save['id'] = form_input_validate(get_nfilter_request_var('item_id'), '', '^[0-9]+$', false, 3); - $save['snmp_id'] = form_input_validate(get_nfilter_request_var('id'), 'snmp_id', '^[0-9]+$', false, 3); - $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); - $save['snmp_community'] = form_input_validate(get_nfilter_request_var('snmp_community'), 'snmp_community', '', false, 3); - $save['snmp_version'] = form_input_validate(get_nfilter_request_var('snmp_version'), 'snmp_version', '', false, 3); - $save['snmp_username'] = form_input_validate(get_nfilter_request_var('snmp_username'), 'snmp_username', '', true, 3); - $save['snmp_password'] = form_input_validate(get_nfilter_request_var('snmp_password'), 'snmp_password', '', true, 3); - $save['snmp_auth_protocol'] = form_input_validate(get_nfilter_request_var('snmp_auth_protocol'), 'snmp_auth_protocol', '', true, 3); - $save['snmp_priv_passphrase'] = form_input_validate(get_nfilter_request_var('snmp_priv_passphrase'), 'snmp_priv_passphrase', '', true, 3); - $save['snmp_priv_protocol'] = form_input_validate(get_nfilter_request_var('snmp_priv_protocol'), 'snmp_priv_protocol', '', true, 3); - $save['snmp_context'] = form_input_validate(get_nfilter_request_var('snmp_context'), 'snmp_context', '', true, 3); - $save['snmp_engine_id'] = form_input_validate(get_nfilter_request_var('snmp_engine_id'), 'snmp_engine_id', '', true, 3); - $save['snmp_port'] = form_input_validate(get_nfilter_request_var('snmp_port'), 'snmp_port', '^[0-9]+$', false, 3); - $save['snmp_timeout'] = form_input_validate(get_nfilter_request_var('snmp_timeout'), 'snmp_timeout', '^[0-9]+$', false, 3); - $save['snmp_retries'] = form_input_validate(get_nfilter_request_var('snmp_retries'), 'snmp_retries', '^[0-9]+$', false, 3); - $save['max_oids'] = form_input_validate(get_nfilter_request_var('max_oids'), 'max_oids', '^[0-9]+$', false, 3); + $save = array(); + + $save['id'] = form_input_validate(get_nfilter_request_var('item_id'), '', '^[0-9]+$', false, 3); + $save['snmp_id'] = form_input_validate(get_nfilter_request_var('id'), 'snmp_id', '^[0-9]+$', false, 3); + $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); + $save['snmp_community'] = form_input_validate(get_nfilter_request_var('snmp_community'), 'snmp_community', '', false, 3); + $save['snmp_version'] = form_input_validate(get_nfilter_request_var('snmp_version'), 'snmp_version', '', false, 3); + $save['snmp_username'] = form_input_validate(get_nfilter_request_var('snmp_username'), 'snmp_username', '', true, 3); + $save['snmp_password'] = form_input_validate(get_nfilter_request_var('snmp_password'), 'snmp_password', '', true, 3); + $save['snmp_auth_protocol'] = form_input_validate(get_nfilter_request_var('snmp_auth_protocol'), 'snmp_auth_protocol', '', true, 3); + $save['snmp_priv_passphrase'] = form_input_validate(get_nfilter_request_var('snmp_priv_passphrase'), 'snmp_priv_passphrase', '', true, 3); + $save['snmp_priv_protocol'] = form_input_validate(get_nfilter_request_var('snmp_priv_protocol'), 'snmp_priv_protocol', '', true, 3); + $save['snmp_context'] = form_input_validate(get_nfilter_request_var('snmp_context'), 'snmp_context', '', true, 3); + $save['snmp_engine_id'] = form_input_validate(get_nfilter_request_var('snmp_engine_id'), 'snmp_engine_id', '', true, 3); + $save['snmp_port'] = form_input_validate(get_nfilter_request_var('snmp_port'), 'snmp_port', '^[0-9]+$', false, 3); + $save['snmp_timeout'] = form_input_validate(get_nfilter_request_var('snmp_timeout'), 'snmp_timeout', '^[0-9]+$', false, 3); + $save['snmp_retries'] = form_input_validate(get_nfilter_request_var('snmp_retries'), 'snmp_retries', '^[0-9]+$', false, 3); + $save['max_oids'] = form_input_validate(get_nfilter_request_var('max_oids'), 'max_oids', '^[0-9]+$', false, 3); + $save['bulk_walk_size'] = form_input_validate(get_nfilter_request_var('bulk_walk_size'), 'bulk_walk_size', '^[\-0-9]+$', false, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_snmp_items'); diff --git a/cli/audit_database.php b/cli/audit_database.php index cb5e97982b..81cbe45dbf 100755 --- a/cli/audit_database.php +++ b/cli/audit_database.php @@ -427,9 +427,9 @@ function report_audit_results($output = true) { $status = db_fetch_row('SHOW TABLE STATUS LIKE "' . $table_name . '"'); if ($status['Collation'] == 'utf8mb4_unicode_ci' || $status['Collation'] == 'utf8_general_ci') { - $text = 'mediumtext'; + $collation = 'utf8'; } else { - $text = 'text'; + $collation = 'latin'; } if ($output) { @@ -516,8 +516,8 @@ function report_audit_results($output = true) { } else { foreach ($cols as $dbcol => $col) { if ($col == 'Type' && $dbc[$dbcol] == 'text') { - if ($text == 'mediumtext') { - $dbc[$dbcol] = $text; + if ($collation == 'latin') { + $dbc[$dbcol] = 'mediumtext'; } } @@ -741,9 +741,14 @@ function report_audit_results($output = true) { function make_column_props(&$dbc) { $alter_cmd = ''; - $dbc['table_default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_default']); - $dbc['table_extra'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_extra']); - $dbc['table_extra'] = trim(str_replace('DEFAULT_GENERATED', '', $dbc['table_extra'])); + if (isset($dbc['table_default'])) { + $dbc['table_default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_default']); + } + + if (isset($dbc['table_extra'])) { + $dbc['table_extra'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_extra']); + $dbc['table_extra'] = trim(str_replace('DEFAULT_GENERATED', '', $dbc['table_extra'])); + } if ($dbc['table_null'] == 'YES') { if ($dbc['table_default'] == 'NULL') { diff --git a/cmd.php b/cmd.php index 6b3d00c8c8..8e1dd2a07d 100755 --- a/cmd.php +++ b/cmd.php @@ -198,6 +198,7 @@ $start = microtime(true); $poller_interval = read_config_option('poller_interval'); $script_timeout = read_config_option('script_timeout'); +$cron_interval = read_config_option('cron_interval'); $active_profiles = read_config_option('active_profiles'); // check arguments @@ -208,7 +209,7 @@ $params1 = array($poller_id); $params2 = array($poller_id, POLLER_ACTION_SCRIPT_PHP, POLLER_ACTION_SCRIPT_PHP_COUNT); - $params3 = array($poller_interval, $poller_interval, $poller_interval, $poller_id); + $params3 = array($poller_interval, $poller_interval, 0, $poller_interval, $poller_id); } else { $sql_where0 = 'WHERE poller_id > ?'; $sql_where1 = ' AND ((h.id >= ? AND h.id <= ?) OR h.id IS NULL)'; @@ -217,7 +218,12 @@ $params1 = array($poller_id, $first, $last); $params2 = array($poller_id, POLLER_ACTION_SCRIPT_PHP, POLLER_ACTION_SCRIPT_PHP_COUNT, $first, $last); - $params3 = array($poller_interval, $poller_interval, $poller_interval, $poller_id, $first, $last); + + if ($cron_interval == $poller_interval) { + $params3 = array($poller_interval, $poller_interval, 0, $poller_interval, $poller_id, $first, $last); + } else { + $params3 = array($poller_interval, $poller_interval, $poller_interval, $poller_interval, $poller_id, $first, $last); + } } if ($debug) { @@ -276,13 +282,11 @@ ); // setup next polling interval - db_execute_prepared( - "UPDATE poller_item AS pi - SET rrd_next_step = IF(rrd_step = ?, 0, IF(rrd_next_step - ? < 0, rrd_step, rrd_next_step - ?)) - WHERE poller_id = ? - $sql_where3", - $params3 - ); + db_execute_prepared("UPDATE poller_item AS pi + SET rrd_next_step = IF(rrd_step = ?, 0, IF(rrd_next_step - ? < 0, rrd_step - ?, rrd_next_step - ?)) + WHERE poller_id = ? + $sql_where3", + $params3); } else { $poller_items = db_fetch_assoc_prepared('SELECT ' . SQL_NO_CACHE . " * FROM poller_item AS pi diff --git a/host_templates.php b/host_templates.php index 88bfe3439b..0695ce06b0 100644 --- a/host_templates.php +++ b/host_templates.php @@ -837,20 +837,18 @@ function clearFilter() { html_end_box(); /* form the 'where' clause for our main sql query */ + $sql_where = ''; + if (get_request_var('filter') != '') { - $sql_where = 'WHERE (host_template.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; - } else { - $sql_where = ''; + $sql_where .= 'WHERE (host_template.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; } if (get_request_var('class') != '-1') { - $sql_where = 'WHERE (host_template.class = ' . db_qstr(get_request_var('class')) . ')'; - } else { - $sql_where = ''; + $sql_where .= 'WHERE (host_template.class = ' . db_qstr(get_request_var('class')) . ')'; } if (get_request_var('has_hosts') == 'true') { - $sql_having = 'HAVING hosts>0'; + $sql_having = 'HAVING hosts > 0'; } else { $sql_having = ''; } diff --git a/include/global_form.php b/include/global_form.php index 4c6b10758f..85d8e69ec9 100644 --- a/include/global_form.php +++ b/include/global_form.php @@ -1694,7 +1694,7 @@ 'method' => 'file' ), 'data_header' => array( - 'friendly_name' => __('Data Source Overrides', 'package'), + 'friendly_name' => __('Data Source Overrides'), 'collapsible' => 'true', 'method' => 'spacer', ), @@ -1708,7 +1708,7 @@ 'default' => '1' ), 'graph_header' => array( - 'friendly_name' => __('Graph/Data Template Overrides', 'package'), + 'friendly_name' => __('Graph/Data Template Overrides'), 'collapsible' => 'true', 'method' => 'spacer', ), @@ -1727,23 +1727,23 @@ 'default' => '' ), 'image_format' => array( - 'friendly_name' => __('Graph Template Image Format', 'package'), - 'description' => __('The Image Format to be used when importing or updating Graph Templates.', 'package'), + 'friendly_name' => __('Graph Template Image Format'), + 'description' => __('The Image Format to be used when importing or updating Graph Templates.'), 'method' => 'drop_array', 'default' => read_config_option('default_image_format'), 'array' => $image_types, ), 'graph_height' => array( 'friendly_name' => __('Graph Template Height', 'pagkage'), - 'description' => __('The Height to be used when importing or updating Graph Templates.', 'package'), + 'description' => __('The Height to be used when importing or updating Graph Templates.'), 'method' => 'textbox', 'default' => read_config_option('default_graph_height'), 'size' => '5', 'max_length' => '5' ), 'graph_width' => array( - 'friendly_name' => __('Graph Template Width', 'package'), - 'description' => __('The Width to be used when importing or updating Graph Templates.', 'package'), + 'friendly_name' => __('Graph Template Width'), + 'description' => __('The Width to be used when importing or updating Graph Templates.'), 'method' => 'textbox', 'default' => read_config_option('default_graph_width'), 'size' => '5', diff --git a/include/global_session.php b/include/global_session.php index 6cc7337917..7b456c6cea 100644 --- a/include/global_session.php +++ b/include/global_session.php @@ -127,6 +127,13 @@ $refreshIsLogout = 'false'; } +/* basic auth times out when the auth provider times out */ +if (read_config_option('auth_method') == 2) { + $myrefresh['seconds'] = 99999999; + $myrefresh['page'] = sanitize_uri($_SERVER['REQUEST_URI']); + $refreshIsLogout = 'false'; +} + ?>