diff options
author | Ermal <eri@pfsense.org> | 2010-09-01 15:51:38 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-09-01 15:51:38 +0000 |
commit | e847108459441367a88a6e8185165f2e33690d67 (patch) | |
tree | f6fef1f6cd75052641248cef39dbfa069203147a /usr/local/www/firewall_virtual_ip.php | |
parent | 8e0c376055498bf0a43ff2114062cd8ef8992a09 (diff) | |
download | pfsense-e847108459441367a88a6e8185165f2e33690d67.zip pfsense-e847108459441367a88a6e8185165f2e33690d67.tar.gz |
Ticket #866 #632. Save old settings or actions to be taken for reconfiguring a route/vip on a tmp file and make use that information when apply settings buttons is clicked. This makes the gui behave as expected.
Diffstat (limited to 'usr/local/www/firewall_virtual_ip.php')
-rwxr-xr-x | usr/local/www/firewall_virtual_ip.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index ec15fdf..ba67914 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -63,9 +63,11 @@ if ($_POST) { if ($_POST['apply']) { $toapplylist = array(); - if (file_exists("{$g['tmp_path']}/firewall_virtual_ip.apply")) - $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/firewall_virtual_ip.apply")); - foreach ($toapplylist as $vid) { + if (file_exists("{$g['tmp_path']}/.firewall_virtual_ip.apply")) + $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.firewall_virtual_ip.apply")); + foreach ($toapplylist as $vid => $ovip) { + if (!empty($ovip)) + interface_vip_bring_down($ovip); if ($a_vip[$vid]) { switch ($a_vip[$vid]['mode']) { case "ipalias": @@ -85,7 +87,7 @@ if ($_POST) { } } } - @unlink("{$g['tmp_path']}/firewall_virtual_ip.apply"); + @unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply"); $retval = 0; $retval |= filter_configure(); $savemsg = get_std_save_message($retval); @@ -108,7 +110,7 @@ if ($_GET['act'] == "del") { } } - if ($a_vip[$_GET['id']]['mode'] == "proxyarp") { + if ($a_vip[$_GET['id']]['mode'] == "ipalias") { $vipiface = $a_vip[$_GET['id']]['interface']; foreach ($a_vip as $vip) { if ($vip['interface'] == $vipiface && $vip['mode'] == "carp") @@ -117,11 +119,13 @@ if ($_GET['act'] == "del") { } } + if (!$input_errors) { // Special case since every proxyarp vip is handled by the same daemon. if ($a_vip[$_GET['id']]['mode'] == "proxyarp") { + $viface = $a_vip[$_GET['id']]['interface']; unset($a_vip[$_GET['id']]); - interface_proxyarp_configure(); + interface_proxyarp_configure($viface); } else { interface_vip_bring_down($a_vip[$_GET['id']]); unset($a_vip[$_GET['id']]); @@ -129,7 +133,6 @@ if ($_GET['act'] == "del") { if (count($config['virtualip']['vip']) == 0) unset($config['virtualip']['vip']); write_config(); - mark_subsystem_dirty('vip'); header("Location: firewall_virtual_ip.php"); exit; } |