mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
plugins: xml sync refactor for ipfw features #1319
This commit is contained in:
parent
6e54b6c00b
commit
2e44a885ca
@ -195,7 +195,7 @@ function plugins_xmlrpc_sync()
|
||||
if (!empty($helper['id']) && !empty($helper['section'])) {
|
||||
$sync_settings[$helper['id']] = $helper;
|
||||
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']);
|
||||
}
|
||||
|
||||
@ -48,3 +48,21 @@ function ipfw_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'])) {
|
||||
$section_cnf['synchronizednsforwarder'] = 'dnsmasq';
|
||||
$section_cnf['synchronizednsresolver'] = 'unbound';
|
||||
$section_cnf['synchronizeschedules'] = 'schedules';
|
||||
$section_cnf['synchronizeshaper'] = 'OPNsense.TrafficShaper';
|
||||
$section_cnf['synchronizecaptiveportal'] = 'OPNsense.captiveportal';
|
||||
|
||||
if (function_exists('plugins_xmlrpc_sync')) {
|
||||
foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) {
|
||||
|
||||
@ -35,11 +35,24 @@ if (!isset($config['hasync']) || !is_array($config['hasync'])) {
|
||||
}
|
||||
$a_hasync = &$config['hasync'];
|
||||
|
||||
$checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthservers', 'synchronizecerts',
|
||||
'synchronizerules', 'synchronizeschedules', 'synchronizealiases', 'synchronizenat',
|
||||
'synchronizeipsec', 'synchronizeopenvpn', 'synchronizedhcpd', 'synchronizewol',
|
||||
'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip',
|
||||
'synchronizednsforwarder','synchronizednsresolver', 'synchronizeshaper', 'synchronizecaptiveportal'
|
||||
$checkbox_names = array(
|
||||
'pfsyncenabled',
|
||||
'synchronizealiases',
|
||||
'synchronizeauthservers',
|
||||
'synchronizecerts',
|
||||
'synchronizedhcpd',
|
||||
'synchronizednsforwarder',
|
||||
'synchronizednsresolver',
|
||||
'synchronizeipsec',
|
||||
'synchronizelb',
|
||||
'synchronizenat',
|
||||
'synchronizeopenvpn',
|
||||
'synchronizerules',
|
||||
'synchronizeschedules',
|
||||
'synchronizestaticroutes',
|
||||
'synchronizeusers',
|
||||
'synchronizevirtualip',
|
||||
'synchronizewol',
|
||||
);
|
||||
|
||||
$syncplugins = array();
|
||||
@ -346,24 +359,6 @@ include("head.inc");
|
||||
</div>
|
||||
</td>
|
||||
</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 -->
|
||||
<?php
|
||||
foreach ($syncplugins as $syncid => $synccnf):?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user