From 3b15c32ca362bc46729d5b652ea5e6dad5650786 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 26 Sep 2012 13:32:10 -0400 Subject: Refine LB entry deletion to make sure blank entries can be removed. --- usr/local/www/load_balancer_monitor.php | 2 +- usr/local/www/load_balancer_pool.php | 2 +- usr/local/www/load_balancer_relay_action.php | 2 +- usr/local/www/load_balancer_relay_protocol.php | 2 +- usr/local/www/load_balancer_virtual_server.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'usr') diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php index 03d3103..b9ae1e2 100755 --- a/usr/local/www/load_balancer_monitor.php +++ b/usr/local/www/load_balancer_monitor.php @@ -64,7 +64,7 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_monitor[$_GET['id']]) { + if (array_key_exists($_GET['id'], $a_monitor)) { /* make sure no pools reference this entry */ if (is_array($config['load_balancer']['lbpool'])) { foreach ($config['load_balancer']['lbpool'] as $pool) { diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php index 0c57359..9c5f179 100755 --- a/usr/local/www/load_balancer_pool.php +++ b/usr/local/www/load_balancer_pool.php @@ -64,7 +64,7 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_pool[$_GET['id']]) { + if (array_key_exists($_GET['id'], $a_pool)) { /* make sure no virtual servers reference this entry */ if (is_array($config['load_balancer']['virtual_server'])) { foreach ($config['load_balancer']['virtual_server'] as $vs) { diff --git a/usr/local/www/load_balancer_relay_action.php b/usr/local/www/load_balancer_relay_action.php index c7d8120..6e0a112 100755 --- a/usr/local/www/load_balancer_relay_action.php +++ b/usr/local/www/load_balancer_relay_action.php @@ -65,7 +65,7 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_action[$_GET['id']]) { + if (array_key_exists($_GET['id'], $a_action)) { /* make sure no relay protocols reference this entry */ if (is_array($config['load_balancer']['lbprotocol'])) { foreach ($config['load_balancer']['lbprotocol'] as $lbp) { diff --git a/usr/local/www/load_balancer_relay_protocol.php b/usr/local/www/load_balancer_relay_protocol.php index e531c80..be812ce 100755 --- a/usr/local/www/load_balancer_relay_protocol.php +++ b/usr/local/www/load_balancer_relay_protocol.php @@ -63,7 +63,7 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_protocol[$_GET['id']]) { + if (array_key_exists($_GET['id'], $a_protocol)) { /* make sure no virtual servers reference this entry */ if (is_array($config['load_balancer']['virtual_server'])) { foreach ($config['load_balancer']['virtual_server'] as $vs) { diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php index a3f21b5..3ae600a 100755 --- a/usr/local/www/load_balancer_virtual_server.php +++ b/usr/local/www/load_balancer_virtual_server.php @@ -63,7 +63,7 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_vs[$_GET['id']]) { + if (array_key_exists($_GET['id'], $a_vs)) { if (!$input_errors) { unset($a_vs[$_GET['id']]); -- cgit v1.1