summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-10 19:35:59 +0000
committerErmal <eri@pfsense.org>2010-12-10 19:35:59 +0000
commit4d775dd000e6efd78959fb627a28cd7aaeda744d (patch)
tree6ff50272eaeaaf5111648bb1a1de7f3175e769ad /usr/local
parent602cb4b00c590e2efcd5a91ea4d7ec2d68c4034b (diff)
downloadpfsense-4d775dd000e6efd78959fb627a28cd7aaeda744d.zip
pfsense-4d775dd000e6efd78959fb627a28cd7aaeda744d.tar.gz
Be consistent on shifting array during authentication. Also check for array to avoid strange errors.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/xmlrpc.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index b7bf474..3941ea0 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -159,7 +159,7 @@ function restore_config_section_xmlrpc($raw_params) {
if(!xmlrpc_auth($params))
return $xmlrpc_g['return']['authfail'];
$vipbackup = array();
- if (isset($params[1]['virtualip'])) {
+ if (isset($params[0]['virtualip'])) {
if(is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip)
interface_vip_bring_down($vip);
@@ -169,9 +169,11 @@ function restore_config_section_xmlrpc($raw_params) {
// For vip section, first keep items sent from the master
$config = array_merge($config, $params[0]);
// Then add ipalias and proxyarp types already defined on the backup
- foreach ($vipbackup as $vip) {
- if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp'))
- $config['virtualip']['vip'][]=$vip ;
+ if (is_array($vipbackup)) {
+ foreach ($vipbackup as $vip) {
+ if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp'))
+ $config['virtualip']['vip'][]=$vip ;
+ }
}
$mergedkeys = implode(",", array_keys($params[0]));
write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
@@ -219,7 +221,7 @@ function merge_config_section_xmlrpc($raw_params) {
$params = xmlrpc_params_to_php($raw_params);
if(!xmlrpc_auth($params))
return $xmlrpc_g['return']['authfail'];
- if (isset($params[1]['virtualip'])) {
+ if (isset($params[0]['virtualip'])) {
if(is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip)
interface_vip_bring_down($vip);
OpenPOWER on IntegriCloud