From 82ae5cfc97ea6dcd5b98095d272364cf007a78cd Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 14 Feb 2008 04:27:51 +0000 Subject: * Add merge_installedpackages_section_xmlrpc() call used for merging specific sub items without replacing the entire area with just this item * Adjust TinyDNS sync to use this new method to avoid replacing the entire destination area which also whipes out all other installd package information. --- usr/local/www/xmlrpc.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'usr/local/www/xmlrpc.php') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index c6523a1..a469910 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -105,6 +105,30 @@ function restore_config_section_xmlrpc($raw_params) { 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']; +} + + /*****************************/ -- cgit v1.1