summaryrefslogtreecommitdiffstats
path: root/usr/local/www/xmlrpc.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-08-20 13:04:08 +0000
committerErmal <eri@pfsense.org>2010-08-20 13:04:08 +0000
commit19b5c3e7f62f6c08ffef434a89a8c1147d21e82a (patch)
tree24049c0d938d6582b139270cd54db9aca5ef064c /usr/local/www/xmlrpc.php
parent68e1bc0f21ece48c5901237ec32829eec274e4a4 (diff)
downloadpfsense-19b5c3e7f62f6c08ffef434a89a8c1147d21e82a.zip
pfsense-19b5c3e7f62f6c08ffef434a89a8c1147d21e82a.tar.gz
Ticket #601. If 'virtualip' section is going to be restored or merged through xmlrpc bring down all vips which will be brough up later on from the configure_carp call. This ensures that the peers on the cluster stay current to each other.
Diffstat (limited to 'usr/local/www/xmlrpc.php')
-rwxr-xr-xusr/local/www/xmlrpc.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 454177a..93ce802 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -155,7 +155,14 @@ $restore_config_section_sig = array(
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'];
+ if(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
+ if (isset($params[0]['virtualip'])) {
+ if(is_array($config['virtualip']['vip'])) {
+ foreach ($config['virtualip']['vip'] as $vip)
+ interface_vip_bring_down($vip);
+ }
+ }
$config = array_merge($config, $params[0]);
$mergedkeys = implode(",", array_keys($params[0]));
write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
@@ -201,7 +208,14 @@ $merge_config_section_sig = array(
function merge_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'];
+ if(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
+ if (isset($params[0]['virtualip'])) {
+ if(is_array($config['virtualip']['vip'])) {
+ foreach ($config['virtualip']['vip'] as $vip)
+ interface_vip_bring_down($vip);
+ }
+ }
$config = array_merge_recursive_unique($config, $params[0]);
$mergedkeys = implode(",", array_keys($params[0]));
write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
OpenPOWER on IntegriCloud