From 5fbee6aa3ac56759aaccf13067ec8ca3d61bf8e5 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 8 Jul 2008 21:23:17 +0000 Subject: remove slbd_configure and start removal of gateway stuff from load balancer screens --- usr/local/www/load_balancer_pool.php | 10 +- usr/local/www/load_balancer_pool_edit.php | 170 +------------------------ usr/local/www/load_balancer_virtual_server.php | 1 - 3 files changed, 8 insertions(+), 173 deletions(-) diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php index d40d712..b44fa2a 100755 --- a/usr/local/www/load_balancer_pool.php +++ b/usr/local/www/load_balancer_pool.php @@ -44,7 +44,6 @@ if ($_POST) { config_lock(); $retval |= filter_configure(); - $retval |= slbd_configure(); $retval |= relayd_configure(); config_unlock(); @@ -140,14 +139,7 @@ include("head.inc"); "; - } - } else { - echo $vipent['monitor']; - } + echo $vipent['monitor']; ?> diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index 5aadeae..c412295 100755 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -42,7 +42,6 @@ else if (isset($id) && $a_pool[$id]) { $pconfig['monitorip'] = $a_pool[$id]['monitorip']; - $pconfig['type'] = $a_pool[$id]['type']; $pconfig['behaviour'] = $a_pool[$id]['behaviour']; $pconfig['name'] = $a_pool[$id]['name']; $pconfig['desc'] = $a_pool[$id]['desc']; @@ -62,13 +61,8 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - if($_POST['type'] == "server") { - $reqdfields = explode(" ", "name port monitor servers"); - $reqdfieldsn = explode(",", "Name,Port,Monitor,Server List"); - } else { - $reqdfields = explode(" ", "name servers"); - $reqdfieldsn = explode(",", "Name,Server List"); - } + $reqdfields = explode(" ", "name port monitor servers"); + $reqdfieldsn = explode(",", "Name,Port,Monitor,Server List"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -82,52 +76,20 @@ if ($_POST) { if (is_array($_POST['servers'])) { foreach($pconfig['servers'] as $svrent) { if (!is_ipaddr($svrent)) { - if($_POST['type'] == "server") { - $input_errors[] = "{$svrent} is not a valid IP address (in \"enabled\" list)."; - } else { - $split_ip = split("\|", $svrent); - if(!is_ipaddr($split_ip[1])) - $input_errors[] = "{$split_ip[1]} is not a valid IP address (in \"enabled\" list)."; - } + $input_errors[] = "{$svrent} is not a valid IP address (in \"enabled\" list)."; } } } if (is_array($_POST['serversdisabled'])) { foreach($pconfig['serversdisabled'] as $svrent) { if (!is_ipaddr($svrent)) { - if($_POST['type'] == "server") { - $input_errors[] = "{$svrent} is not a valid IP address (in \"disabled\" list)."; - } else { - $split_ip = split("\|", $svrent); - if(!is_ipaddr($split_ip[1])) - $input_errors[] = "{$split_ip[1]} is not a valid IP address (in \"disabled\" list)."; - } + $input_errors[] = "{$svrent} is not a valid IP address (in \"disabled\" list)."; } } } - /* make sure that we are not entering a interface ip as a gateway. This creates a routing loop. */ - if($_POST['type'] == "gateway") { - $ifdescrs = array ("wan"); - for ($j = 1; isset ($config['interfaces']['opt' . $j]); $j++) { - $ifdescrs['opt' . $j] = "opt" . $j; - } - if(is_array($pconfig['servers'])) { - foreach($pconfig['servers'] as $svrent) { - $split_ip = split("\|", $svrent); - foreach($ifdescrs as $iface) { - if($config['interfaces'][$iface]['ipaddr'] <> "") - if($config['interfaces'][$iface]['ipaddr'] == $split_ip[0]) - $input_errors[] = "{$split_ip[0]} is currently being referenced by an interface IP address on {$iface}."; - } - } - } - } - - if($_POST['type'] == "server") { - if ($_POST['monitor'] != "TCP" && $_POST['monitor'] != "HTTP" && $_POST['monitor'] != "ICMP") - $input_errors[] = "Invalid monitor chosen."; - } + if ($_POST['monitor'] != "TCP" && $_POST['monitor'] != "HTTP" && $_POST['monitor'] != "ICMP") + $input_errors[] = "Invalid monitor chosen."; if(!isset($_POST['behaviour'])) { $input_errors[] = "No pool behaviour chosen."; @@ -144,7 +106,6 @@ if ($_POST) { if(is_ipaddr($poolent['monitorip'])) mwexec("route delete {$poolent['monitorip']}"); - update_if_changed("type", $poolent['type'], $_POST['type']); update_if_changed("behaviour", $poolent['behaviour'], $_POST['behaviour']); update_if_changed("monitorip", $poolent['monitorip'], $_POST['monitorip']); update_if_changed("name", $poolent['name'], $_POST['name']); @@ -185,78 +146,6 @@ include("head.inc"); diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php index b261e4b..77b8884 100755 --- a/usr/local/www/load_balancer_virtual_server.php +++ b/usr/local/www/load_balancer_virtual_server.php @@ -44,7 +44,6 @@ if ($_POST) { $retval = 0; config_lock(); $retval |= filter_configure(); - $retval |= slbd_configure(); $retval |= relayd_configure(); config_unlock(); $savemsg = get_std_save_message($retval); -- cgit v1.1