Commit 83b13264 authored by Franco Fichtner's avatar Franco Fichtner

plugins: protect calls to functions as done elsewhere

(cherry picked from commit baa813eb)
parent e0c3e722
...@@ -294,9 +294,12 @@ if (isset($config['hasync']) && is_array($config['hasync'])) { ...@@ -294,9 +294,12 @@ if (isset($config['hasync']) && is_array($config['hasync'])) {
$section_cnf['synchronizeschedules'] = 'schedules'; $section_cnf['synchronizeschedules'] = 'schedules';
$section_cnf['synchronizeshaper'] = 'OPNsense.TrafficShaper'; $section_cnf['synchronizeshaper'] = 'OPNsense.TrafficShaper';
$section_cnf['synchronizecaptiveportal'] = 'OPNsense.captiveportal'; $section_cnf['synchronizecaptiveportal'] = 'OPNsense.captiveportal';
if (function_exists('plugins_xmlrpc_sync')) {
foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) { foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) {
$section_cnf['synchronize'.$syncid] = $syncconf['section']; $section_cnf['synchronize'.$syncid] = $syncconf['section'];
} }
}
$sections = array(); $sections = array();
foreach ($section_cnf as $cnf_key => $cnf_sections) { foreach ($section_cnf as $cnf_key => $cnf_sections) {
......
...@@ -41,7 +41,14 @@ $checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthser ...@@ -41,7 +41,14 @@ $checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthser
'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip', 'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip',
'synchronizednsforwarder','synchronizednsresolver', 'synchronizeshaper', 'synchronizecaptiveportal' 'synchronizednsforwarder','synchronizednsresolver', 'synchronizeshaper', 'synchronizecaptiveportal'
); );
foreach (array_keys(plugins_xmlrpc_sync()) as $key) {
$syncplugins = array();
if (function_exists('plugins_xmlrpc_sync')) {
$syncplugins = plugins_xmlrpc_sync();
}
foreach (array_keys($syncplugins) as $key) {
$checkbox_names[] = 'synchronize'.$key; $checkbox_names[] = 'synchronize'.$key;
} }
...@@ -359,7 +366,7 @@ include("head.inc"); ...@@ -359,7 +366,7 @@ include("head.inc");
</tr> </tr>
<!-- Hook xmlrpc sync plugins --> <!-- Hook xmlrpc sync plugins -->
<?php <?php
foreach (plugins_xmlrpc_sync() as $syncid => $synccnf):?> foreach ($syncplugins as $syncid => $synccnf):?>
<tr> <tr>
<td><a id="help_for_synchronize<?=$syncid?>" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=$synccnf['description'];?></td> <td><a id="help_for_synchronize<?=$syncid?>" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=$synccnf['description'];?></td>
<td> <td>
......
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