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,8 +294,11 @@ 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'];
if (function_exists('plugins_xmlrpc_sync')) {
foreach (plugins_xmlrpc_sync() as $syncid => $syncconf) {
$section_cnf['synchronize'.$syncid] = $syncconf['section'];
}
}
$sections = array();
......
......@@ -41,7 +41,14 @@ $checkbox_names = array('pfsyncenabled', 'synchronizeusers', 'synchronizeauthser
'synchronizestaticroutes', 'synchronizelb', 'synchronizevirtualip',
'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;
}
......@@ -359,7 +366,7 @@ include("head.inc");
</tr>
<!-- Hook xmlrpc sync plugins -->
<?php
foreach (plugins_xmlrpc_sync() as $syncid => $synccnf):?>
foreach ($syncplugins as $syncid => $synccnf):?>
<tr>
<td><a id="help_for_synchronize<?=$syncid?>" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=$synccnf['description'];?></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