From 4e8c89fdbedce2188da48f8db1c0dfe83df36435 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 1 Feb 2011 19:09:37 +0000 Subject: Allow ipalias with carp as parent interface to be synchronized. --- usr/local/www/xmlrpc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'usr/local') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index ea0166b..ebb3a24 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -171,7 +171,7 @@ function restore_config_section_xmlrpc($raw_params) { // Then add ipalias and proxyarp types already defined on the backup if (is_array($vipbackup)) { foreach ($vipbackup as $vip) { - if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) + if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip") array_unshift($config['virtualip']['vip'], $vip); } } @@ -226,8 +226,16 @@ function merge_config_section_xmlrpc($raw_params) { foreach ($config['virtualip']['vip'] as $vip) interface_vip_bring_down($vip); } + $vipbackup = $config['virtualip']['vip']; } $config = array_merge_recursive_unique($config, $params[0]); + // Then add ipalias and proxyarp types already defined on the backup + if (is_array($vipbackup)) { + foreach ($vipbackup as $vip) { + if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip") + array_unshift($config['virtualip']['vip'], $vip); + } + } $mergedkeys = implode(",", array_keys($params[0])); write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client."); interfaces_vips_configure(); -- cgit v1.1 From b0899ee4581548dde8060370a3063ffd18462883 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 1 Feb 2011 19:32:10 +0000 Subject: Test for arrach before foreach'ing. Reported-by: http://forum.pfsense.org/index.php/topic,32865.0.html --- usr/local/www/firewall_rules.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index b5a1ce0..cf50140 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -162,9 +162,11 @@ if ($config['pptpd']['mode'] == "server") if(have_ruleint_access("pptp")) $iflist['pptp'] = "PPTP VPN"; -foreach ($config['pppoes']['pppoe'] as $pppoes) - if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe")) - $iflist['pppoe'] = "PPPoE Server"; +if (is_array($config['pppoes']['pppoe'])) { + foreach ($config['pppoes']['pppoe'] as $pppoes) + if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe")) + $iflist['pppoe'] = "PPPoE Server"; +} /* add ipsec interfaces */ if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])) -- cgit v1.1 From b44f72d1b120b2f23d3f01a60df1d95f6346da74 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 2 Feb 2011 16:20:42 -0500 Subject: Reinit rules after edit --- usr/local/www/services_captiveportal_hostname_edit.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php index b6e580a..c5ed985 100755 --- a/usr/local/www/services_captiveportal_hostname_edit.php +++ b/usr/local/www/services_captiveportal_hostname_edit.php @@ -133,19 +133,8 @@ if ($_POST) { write_config(); - if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) { - $rules = ""; - $hostname = gethostbyname($oldip); - if($hostname) - for ($i = 3; $i < 10; $i++) - $rules .= "table {$i} delete {$hostname}\n"; - $hostname = gethostbyname($ip); - if(is_ipaddr($hostname)) - $rules .= captiveportal_allowedip_configure_entry($hostname); - file_put_contents("{$g['tmp_path']}/allowedhostname_tmp{$id}", $rules); - mwexec("/sbin/ipfw -q {$g['tmp_path']}/allowedhostname_tmp{$id}"); - @unlink("{$g['tmp_path']}/allowedhostname_tmp{$id}"); - } + if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) + captiveportal_init_rules(true); header("Location: services_captiveportal_hostname.php"); exit; -- cgit v1.1 From 442dc4a4e6a6fbd07a250e01785dbf6833245f81 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 2 Feb 2011 16:27:38 -0500 Subject: Do not call true here according to Ermal --- usr/local/www/services_captiveportal_hostname_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local') diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php index c5ed985..a199341 100755 --- a/usr/local/www/services_captiveportal_hostname_edit.php +++ b/usr/local/www/services_captiveportal_hostname_edit.php @@ -134,7 +134,7 @@ if ($_POST) { write_config(); if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) - captiveportal_init_rules(true); + captiveportal_init_rules(); header("Location: services_captiveportal_hostname.php"); exit; -- cgit v1.1