Project

General

Profile

« Previous | Next » 

Revision a9c6f68a

Added by Bill Marquette almost 20 years ago

Fixes - moved to lbpool instead of pool as we had a small listtags conflict

View differences:

usr/local/www/load_balancer_pool.php
32 32

  
33 33
require("guiconfig.inc");
34 34

  
35
if (!is_array($config['load_balancer']['pool'])) {
36
	$config['load_balancer']['pool'] = array();
35
if (!is_array($config['load_balancer']['lbpool'])) {
36
	$config['load_balancer']['lbpool'] = array();
37 37
}
38
$a_pool = &$config['load_balancer']['pool'];
38
$a_pool = &$config['load_balancer']['lbpool'];
39 39

  
40 40
if ($_POST) {
41 41
	$pconfig = $_POST;
usr/local/www/load_balancer_pool_edit.php
31 31
*/
32 32

  
33 33
require("guiconfig.inc");
34
if (!is_array($config['load_balancer']['pool'])) {
35
        $config['load_balancer']['pool'] = array();
34
if (!is_array($config['load_balancer']['lbpool'])) {
35
        $config['load_balancer']['lbpool'] = array();
36 36
}
37
$a_pool = &$config['load_balancer']['pool'];
37
$a_pool = &$config['load_balancer']['lbpool'];
38 38

  
39 39
if (isset($_POST['id']))
40 40
	$id = $_POST['id'];
......
60 60
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
61 61

  
62 62
	/* Ensure that our pool names are unique */
63
	for ($i=0; isset($config['load_balancer']['pool'][$i]); $i++)
64
		if (($_POST['name'] == $config['load_balancer']['pool'][$i]['name']) && ($i != $id))
63
	for ($i=0; isset($config['load_balancer']['lbpool'][$i]); $i++)
64
		if (($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name']) && ($i != $id))
65 65
			$input_errors[] = "This pool name has already been used.  Pool names must be unique.";
66 66

  
67 67
	if (!$input_errors) {
usr/local/www/load_balancer_virtual_server.php
54 54

  
55 55
if ($_GET['act'] == "del") {
56 56
	if ($a_vs[$_GET['id']]) {
57
		/* make sure no inbound NAT mappings reference this entry */
58
		if (is_array($config['nat']['rule'])) {
59
			foreach ($config['nat']['rule'] as $rule) {
60
				if ($rule['external-address'] == $a_vs[$_GET['id']]['ipaddr']) {
61
					$input_errors[] = "This entry cannot be deleted because it is still referenced by at least one NAT mapping.";
62
					break;
63
				}
64
			}
65
		}
66 57

  
67 58
		if (!$input_errors) {
68 59
			unset($a_vs[$_GET['id']]);
69 60
			write_config();
70 61
			touch($d_vsconfdirty_path);
71
			header("Location: firewall_virtual_ip.php");
62
			header("Location: load_balancer_virtual_server.php");
72 63
			exit;
73 64
		}
74 65
	}
......
81 72
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
82 73
<?php include("fbegin.inc"); ?>
83 74
<p class="pgtitle"><?=$pgtitle?></p>
84
<form action="firewall_virtual_ip.php" method="post">
75
<form action="load_balancer_virtual_server.php" method="post">
85 76
<?php if ($input_errors) print_input_errors($input_errors); ?>
86 77
<?php if ($savemsg) print_info_box($savemsg); ?>
87 78
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
88
<?php print_info_box_np("The VIP configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
79
<?php print_info_box_np("The virtual server configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
89 80
<?php endif; ?>
90 81
<table width="100%" border="0" cellpadding="0" cellspacing="0">
91 82
  <tr><td class="tabnavtbl">
......
125 116
                    <table border="0" cellspacing="0" cellpadding="1">
126 117
                      <tr>
127 118
                        <td valign="middle"><a href="load_balancer_virtual_server_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
128
                        <td valign="middle"><a href="firewall_virtual_ip.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
119
                        <td valign="middle"><a href="load_balancer_virtual_server.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
129 120
                      </tr>
130 121
                    </table>
131 122
                  </td>
usr/local/www/load_balancer_virtual_server_edit.php
58 58

  
59 59
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
60 60

  
61
	/* Ensure that our pool names are unique */
62
	for ($i=0; isset($config['load_balancer']['pool'][$i]); $i++)
63
		if (($_POST['name'] == $config['load_balancer']['pool'][$i]['name']) && ($i != $id))
64
			$input_errors[] = "This pool name has already been used.  Pool names must be unique.";
65

  
66 61
	if (!$input_errors) {
67 62
		$vsent = array();
68 63
		
......
120 115
                <tr align="left">
121 116
		  <td width="22%" valign="top" class="vncellreq">Virtual Server Pool</td>
122 117
                  <td width="78%" class="vtable" colspan="2">
123
                    <select id="monitor" name="monitor">
118
                    <select id="pool" name="pool">
124 119
			<?php
125
				for ($i = 0; isset($config['load_balancer']['pool'][$i]); $i++) {
126
					echo "<option value=\"{$config['load_balancer']['pool'][$i]['name']}\">{$config['load_balancer']['pool'][$i]['name']}</option>";
120
				for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
121
					echo "<option value=\"{$config['load_balancer']['lbpool'][$i]['name']}\">{$config['load_balancer']['lbpool'][$i]['name']}</option>";
127 122
				}
128 123
			?>
129 124
			</select>

Also available in: Unified diff