summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-14 04:27:56 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-14 04:27:56 +0000
commitcdcb273e5e757051326de680f90f41ebb3ec4f68 (patch)
treeb41d3cf7aa88f2514817b7cceff391814083ad8f
parentac65e36e9f31ed79e3879c1dc536237efa15e60f (diff)
downloadpfsense-cdcb273e5e757051326de680f90f41ebb3ec4f68.zip
pfsense-cdcb273e5e757051326de680f90f41ebb3ec4f68.tar.gz
* Add merge_installedpackages_section_xmlrpc() call used for merging
specific <installedpackages><AREANAME> sub items without replacing the entire <installedpackages> area with just this item * Adjust TinyDNS sync to use this new method to avoid replacing the entire destination <installedpackages> area which also whipes out all other installd package information.
-rwxr-xr-xusr/local/www/xmlrpc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index cc8f05c..dad5f3e 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -99,12 +99,36 @@ function restore_config_section_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+
$config = array_merge($config, $params[0]);
$mergedkeys = implode(",", array_keys($params[0]));
write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
return $xmlrpc_g['return']['true'];
}
+
+/*****************************/
+
+
+$merge_config_section_doc = 'XMLRPC wrapper for merging package sections. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.';
+$merge_config_section_sig = array(
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String,
+ $XML_RPC_Struct
+ )
+ );
+
+function merge_installedpackages_section_xmlrpc($raw_params) {
+ global $config, $xmlrpc_g;
+ $params = xmlrpc_params_to_php($raw_params);
+ if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+ $config['installedpackages'] = array_merge($config['installedpackages'], $params[0]);
+ $mergedkeys = implode(",", array_keys($params[0]));
+ write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
+ return $xmlrpc_g['return']['true'];
+}
+
/*****************************/
@@ -234,6 +258,9 @@ $server = new XML_RPC_Server(
'pfsense.merge_config_section' => array('function' => 'merge_config_section_xmlrpc',
'signature' => $merge_config_section_sig,
'docstring' => $merge_config_section_doc),
+ 'pfsense.merge_installedpackages_section_xmlrpc' => array('function' => 'merge_installedpackages_section_xmlrpc',
+ 'signature' => $merge_config_section_sig,
+ 'docstring' => $merge_config_section_doc),
'pfsense.filter_configure' => array('function' => 'filter_configure_xmlrpc',
'signature' => $filter_configure_sig,
'docstring' => $filter_configure_doc),
OpenPOWER on IntegriCloud