From b65355f148f4137d9538030fa53eb95c192e3646 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Thu, 31 Mar 2005 15:01:46 +0000 Subject: Test for carp_sync_xml's presence before attempting to define it. --- packages/carp_sync_client.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/carp_sync_client.php b/packages/carp_sync_client.php index 7cc5d792..8579b709 100644 --- a/packages/carp_sync_client.php +++ b/packages/carp_sync_client.php @@ -36,15 +36,17 @@ require_once("xmlparse_pkg.inc"); /* Include pfSense helper functions. */ require_once("config.inc"); require_once("functions.inc"); -function carp_sync_xml($url, $password, $section, $section_xml, $method = 'pfsense.restore_config_section') { - $params = array(new XML_RPC_Value($password, 'string'), - new XML_RPC_Value($section, 'string'), - new XML_RPC_Value($section_xml, 'string')); - $msg = new XML_RPC_Message($method, $params); - $cli = new XML_RPC_Client($url, '/xmlrpc.php'); - $cli->setCredentials('admin', $password); - $resp = $cli->send($msg); - return true; +if(!function_exists('carp_sync_xml')) { + function carp_sync_xml($url, $password, $section, $section_xml, $method = 'pfsense.restore_config_section') { + $params = array(new XML_RPC_Value($password, 'string'), + new XML_RPC_Value($section, 'string'), + new XML_RPC_Value($section_xml, 'string')); + $msg = new XML_RPC_Message($method, $params); + $cli = new XML_RPC_Client($url, '/xmlrpc.php'); + $cli->setCredentials('admin', $password); + $resp = $cli->send($msg); + return true; + } } if($already_processed != 1) { -- cgit v1.2.3