diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c95a8c6..01462a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ --- develop --- +* compat: Lower the minimum Cacti compatibility floor (INFO `compat`) from 1.2.23 to 1.2.29. On Cacti 1.2.31+ the CSP-safe `cactiReturnTo` Cancel buttons bind automatically; on 1.2.29/1.2.30 the README documents the one-time `applySkin()` snippet needed +* security: Move the syslog pages' inline event handlers to CSP-safe bindings so the pages no longer trip Cacti's Content-Security-Policy script-src-attr directive: the confirmation Cancel buttons use the `cactiReturnTo` class, and the filter selects (plus the collapse-filters toggle) are bound via a delegated handler in `js/functions.js` keyed off a `data-onchange` attribute so each select still calls its own `applyFilter*` function * feature: Add Remote Data Collector processing, rules-sync, and record-storage options to the setup advisor; reject Aria selections whenever any collector option is enabled * change: Use TEXT for message columns previously limited to VARCHAR(2048), including existing installations * dev: Size the severity-legend chips to the longest label and lay them out as a CSS grid so every chip stays equal width as the legend wraps (matching the thold/monitor/servcheck/mactrack legends) diff --git a/INFO b/INFO index ee750f57..eb6766c3 100644 --- a/INFO +++ b/INFO @@ -26,6 +26,6 @@ longname = Syslog Monitoring author = The Cacti Group email = homepage = http://www.cacti.net -compat = 1.2.23 +compat = 1.2.29 nosync = config.php capabilities = online_view:1, online_mgmt:1, offline_view:1, offline_mgmt:1, remote_collect:0, remote_poller:1 diff --git a/README.md b/README.md index 265e7f3f..3d12c069 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,22 @@ exercises the syslog poller end-to-end on the PHP 8.2-8.4 matrix on Linux. The Docker E2E runner refuses unsafe temporary-directory paths before performing recursive cleanup. +## Cacti compatibility + +This plugin supports Cacti 1.2.29 and later. On Cacti 1.2.31 and later the +confirmation-page Cancel buttons work automatically. If you are running Cacti +between 1.2.29 and 1.2.31 (i.e. 1.2.29 or 1.2.30), please add the function +below to the `applySkin()` function in `include/layout.js` to enable the Cancel +buttons on forms to work: + +```js +$(document).off('click.cactiReturnTo', '.cactiReturnTo') + .on('click.cactiReturnTo', '.cactiReturnTo', function(event) { + event.preventDefault(); + cactiReturnTo($(this).attr('data-url')); + }); +``` + ## Installation To install the syslog plugin, simply copy the plugin_syslog directory to Cacti's diff --git a/js/functions.js b/js/functions.js index 9c81ef16..c92a7cd6 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1387,3 +1387,21 @@ function testSyslogRule(formSelector, dialogSelector, title) { } }); } + +jQuery(function() { +jQuery(document).off('change.syslogFilter', '.syslogFilter') +.on('change.syslogFilter', '.syslogFilter', function() { +var fn = jQuery(this).data('onchange'); + +if (fn && typeof window[fn] === 'function') { +window[fn](); +} +}); + +jQuery(document).off('click.syslogToggle', '#syslog_search_toggle') +.on('click.syslogToggle', '#syslog_search_toggle', function() { +if (typeof toggleSyslogSearch === 'function') { +toggleSyslogSearch(); +} +}); +}); \ No newline at end of file diff --git a/syslog.php b/syslog.php index 44fbc7d0..cfce6eed 100644 --- a/syslog.php +++ b/syslog.php @@ -1870,7 +1870,7 @@ function syslog_filter(string $sql_where, string $tab): void { title='' data-hide='' data-show='' - onclick='toggleSyslogSearch()'> + >