diff options
author | Colin Smith <colin@pfsense.org> | 2005-03-31 15:01:46 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-03-31 15:01:46 +0000 |
commit | b65355f148f4137d9538030fa53eb95c192e3646 (patch) | |
tree | 45f45f2f1b5aea0bdb66ded03c377a716061799a | |
parent | d98d979d780126ea5f6ae768e45ce9eff9eef25e (diff) | |
download | pfsense-packages-b65355f148f4137d9538030fa53eb95c192e3646.tar.gz pfsense-packages-b65355f148f4137d9538030fa53eb95c192e3646.tar.bz2 pfsense-packages-b65355f148f4137d9538030fa53eb95c192e3646.zip |
Test for carp_sync_xml's presence before attempting to define it.
-rw-r--r-- | packages/carp_sync_client.php | 20 |
1 files 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) { |