Commit 2e44a885 authored by Franco Fichtner's avatar Franco Fichtner

plugins: xml sync refactor for ipfw features #1319

parent 6e54b6c0
...@@ -195,7 +195,7 @@ function plugins_xmlrpc_sync() ...@@ -195,7 +195,7 @@ function plugins_xmlrpc_sync()
if (!empty($helper['id']) && !empty($helper['section'])) { if (!empty($helper['id']) && !empty($helper['section'])) {
$sync_settings[$helper['id']] = $helper; $sync_settings[$helper['id']] = $helper;
if (empty($helper['help'])) { if (empty($helper['help'])) {
$sync_settings[$helper['id']]['help'] = sprintf(gettext('Synchronize %s settings to backup'), $helper['description']); $sync_settings[$helper['id']]['help'] = sprintf(gettext('Automatically synchronize the %s configuration to the other HA host when changes are made.'), $helper['description']);
} }
unset($sync_settings[$helper['id']]['id']); unset($sync_settings[$helper['id']]['id']);
} }
......
...@@ -48,3 +48,21 @@ function ipfw_services() ...@@ -48,3 +48,21 @@ function ipfw_services()
return $services; return $services;
} }
function ipfw_xmlrpc_sync()
{
$result = array();
$result[] = array(
'description' => gettext('Traffic Shaper'),
'section' => 'OPNsense.TrafficShaper',
'id' => 'shaper',
);
$result[] = array(
'description' => gettext('Captive Portal'),
'section' => 'OPNsense.captiveportal',
'id' => 'captiveportal',
);
return $result;
}
...@@ -292,8 +292,6 @@ if (isset($config['hasync']) && is_array($config['hasync'])) { ...@@ -292,8 +292,6 @@ if (isset($config['hasync']) && is_array($config['hasync'])) {
$section_cnf['synchronizednsforwarder'] = 'dnsmasq'; $section_cnf['synchronizednsforwarder'] = 'dnsmasq';
$section_cnf['synchronizednsresolver'] = 'unbound'; $section_cnf['synchronizednsresolver'] = 'unbound';
$section_cnf['synchronizeschedules'] = 'schedules'; $section_cnf['synchronizeschedules'] = 'schedules';
$section_cnf['synchronizeshaper'] = 'OPNsense.TrafficShaper';
$section_cnf['synchronizecaptiveportal'] = 'OPNsense.captiveportal';
if (function_exists('plugins_xmlrpc_sync')) { if (function_exists('plugins_xmlrpc_sync')) {
foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) { foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) {
......
...@@ -35,11 +35,24 @@ if (!isset($config['hasync']) || !is_array($config['hasync'])) { ...@@ -35,11 +35,24 @@ if (!isset($config['hasync']) || !is_array($config['hasync'])) {
} }
$a_hasync = &$config['hasync']; $a_hasync = &$config['hasync'];
$checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthservers', 'synchronizecerts', $checkbox_names = array(
'synchronizerules', 'synchronizeschedules', 'synchronizealiases', 'synchronizenat', 'pfsyncenabled',
'synchronizeipsec', 'synchronizeopenvpn', 'synchronizedhcpd', 'synchronizewol', 'synchronizealiases',
'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip', 'synchronizeauthservers',
'synchronizednsforwarder','synchronizednsresolver', 'synchronizeshaper', 'synchronizecaptiveportal' 'synchronizecerts',
'synchronizedhcpd',
'synchronizednsforwarder',
'synchronizednsresolver',
'synchronizeipsec',
'synchronizelb',
'synchronizenat',
'synchronizeopenvpn',
'synchronizerules',
'synchronizeschedules',
'synchronizestaticroutes',
'synchronizeusers',
'synchronizevirtualip',
'synchronizewol',
); );
$syncplugins = array(); $syncplugins = array();
...@@ -346,24 +359,6 @@ include("head.inc"); ...@@ -346,24 +359,6 @@ include("head.inc");
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td><a id="help_for_synchronizeshaper" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Traffic Shaper') ?></td>
<td>
<input type="checkbox" name="synchronizeshaper" value="on" <?=!empty($pconfig['synchronizeshaper']) ? "checked=\"checked\"" :"";?> />
<div class="hidden" for="help_for_synchronizeshaper">
<?=gettext('Automatically sync the TrafficShaper configuration to the other HA host when changes are made.') ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_synchronizecaptiveportal" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Captive Portal') ?></td>
<td>
<input type="checkbox" name="synchronizecaptiveportal" value="on" <?=!empty($pconfig['synchronizecaptiveportal']) ? "checked=\"checked\"" :"";?> />
<div class="hidden" for="help_for_synchronizecaptiveportal">
<?=gettext('Automatically sync the Captive Portal configuration to the other HA host when changes are made.') ?>
</div>
</td>
</tr>
<!-- Hook xmlrpc sync plugins --> <!-- Hook xmlrpc sync plugins -->
<?php <?php
foreach ($syncplugins as $syncid => $synccnf):?> foreach ($syncplugins as $syncid => $synccnf):?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment