diff --git a/src/etc/inc/plugins.inc b/src/etc/inc/plugins.inc index 9aa1a880f..78e95bab8 100644 --- a/src/etc/inc/plugins.inc +++ b/src/etc/inc/plugins.inc @@ -183,3 +183,21 @@ function plugins_configure($hook, $verbose = false) } } } + +function plugins_xmlrpc_sync() +{ + $sync_settings = array(); + foreach (plugins_scan() as $name => $path) { + require_once $path; + $func = sprintf('%s_xmlrpc_sync', $name); + if (function_exists($func)) { + foreach ($func() as $helper) { + if (!empty($helper['id']) && !empty($helper['section'])) { + $sync_settings[$helper['id']] = $helper; + unset($sync_settings[$helper['id']]['id']); + } + } + } + } + return $sync_settings; +} diff --git a/src/etc/rc.filter_synchronize b/src/etc/rc.filter_synchronize index da44e2ff4..074d630be 100755 --- a/src/etc/rc.filter_synchronize +++ b/src/etc/rc.filter_synchronize @@ -294,6 +294,9 @@ if (isset($config['hasync']) && is_array($config['hasync'])) { $section_cnf['synchronizeschedules'] = 'schedules'; $section_cnf['synchronizeshaper'] = 'OPNsense.TrafficShaper'; $section_cnf['synchronizecaptiveportal'] = 'OPNsense.captiveportal'; + foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) { + $section_cnf['synchronize'.$syncid] = $syncconf['section']; + } $sections = array(); foreach ($section_cnf as $cnf_key => $cnf_sections) { diff --git a/src/www/system_hasync.php b/src/www/system_hasync.php index b7d6431bd..b6ca16ccd 100644 --- a/src/www/system_hasync.php +++ b/src/www/system_hasync.php @@ -41,7 +41,9 @@ $checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthser 'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip', 'synchronizednsforwarder','synchronizednsresolver', 'synchronizeshaper', 'synchronizecaptiveportal' ); - +foreach (array_keys(plugins_xmlrpc_sync()) as $key) { + $checkbox_names[] = 'synchronize'.$key; +} if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); @@ -355,6 +357,20 @@ include("head.inc"); + + $synccnf):?> + + + + /> + + + +