summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-09-13 17:41:58 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-09-13 17:41:58 +0000
commitc0188bc6d247ee6922784d48725a97645f9e240e (patch)
tree78af97edb9ab92427d2589be87d01322b70a06b2 /etc/inc
parentdc7ddc0ec21486628398e0c28664e5a7bdb66d08 (diff)
downloadpfsense-c0188bc6d247ee6922784d48725a97645f9e240e.zip
pfsense-c0188bc6d247ee6922784d48725a97645f9e240e.tar.gz
Set port in one location and pass to carp_sync_xml()
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc23
1 files changed, 12 insertions, 11 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index d0af950..e0f7f48 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2337,20 +2337,12 @@ function process_carp_rules() {
return $lines;
}
-function carp_sync_xml($url, $password, $section, $section_xml, $method = 'pfsense.restore_config_section') {
+function carp_sync_xml($url, $password, $section, $section_xml, $method = 'pfsense.restore_config_section', $port) {
global $config;
$params = array(new XML_RPC_Value($password, 'string'),
new XML_RPC_Value($section, 'array'),
new XML_RPC_Value($section_xml, 'array'));
$msg = new XML_RPC_Message($method, $params);
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http")
- $port = "80";
- else
- $port = "443";
- }
log_error("begin synchronize XML configuration data to $url on port $port");
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
$cli->setCredentials('admin', $password);
@@ -2376,6 +2368,15 @@ function carp_sync_client() {
$synchronizetoip = $config['system']['webgui']['protocol'];
$synchronizetoip .= "://";
}
+ $port = $config['system']['webgui']['port'];
+ /* if port is empty lets rely on the protocol selection */
+ if($port == "") {
+ if($config['system']['webgui']['protocol'] == "http")
+ $port = "80";
+ else
+ $port = "443";
+ }
+ }
$synchronizetoip .= $carp['synchronizetoip'];
$sections = array();
$sections_xml = array();
@@ -2416,8 +2417,8 @@ function carp_sync_client() {
$sections[] = new XML_RPC_Value('load_balancer', 'string');
}
if(count($sections) > 0) {
- carp_sync_xml($synchronizetoip, $carp['password'], $sections, $sections_xml);
- $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip);
+ carp_sync_xml($synchronizetoip, $carp['password'], $sections, $sections_xml, $port);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip, $port);
$msg = new XML_RPC_Message('pfsense.filter_configure', array(new XML_RPC_Value($carp['password'], 'string')));
$cli->setCredentials('admin', $carp['password']);
$cli->send($msg);
OpenPOWER on IntegriCloud