summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-10-19 12:39:01 -0400
committerjim-p <jimp@pfsense.org>2010-10-19 12:39:01 -0400
commite988813dd2e6ab104660969c80395d1dc7877e3e (patch)
treef22632ef53eaca37f28d5f18ac2097c5aa30ee94
parentc4f5508496be6237334d1006cb029bb079747d45 (diff)
downloadpfsense-e988813dd2e6ab104660969c80395d1dc7877e3e.zip
pfsense-e988813dd2e6ab104660969c80395d1dc7877e3e.tar.gz
desc to descr in Load Balancer config, so they gain CDATA protection and standardize field names. Ticket #320.
-rw-r--r--conf.default/config.xml10
-rw-r--r--etc/inc/globals.inc2
-rw-r--r--etc/inc/upgrade_config.inc24
-rwxr-xr-xusr/local/www/load_balancer_monitor.php2
-rwxr-xr-xusr/local/www/load_balancer_monitor_edit.php8
-rwxr-xr-xusr/local/www/load_balancer_pool.php2
-rwxr-xr-xusr/local/www/load_balancer_pool_edit.php6
-rwxr-xr-xusr/local/www/load_balancer_relay_action.php2
-rwxr-xr-xusr/local/www/load_balancer_relay_action_edit.php6
-rwxr-xr-xusr/local/www/load_balancer_relay_protocol.php2
-rwxr-xr-xusr/local/www/load_balancer_relay_protocol_edit.php8
-rwxr-xr-xusr/local/www/load_balancer_virtual_server.php2
-rwxr-xr-xusr/local/www/load_balancer_virtual_server_edit.php4
-rwxr-xr-xusr/local/www/status_lb_pool.php2
-rwxr-xr-xusr/local/www/status_lb_vs.php2
-rw-r--r--usr/local/www/widgets/widgets/load_balancer_status.widget.php2
16 files changed, 52 insertions, 32 deletions
diff --git a/conf.default/config.xml b/conf.default/config.xml
index 00e7992..4d4729d 100644
--- a/conf.default/config.xml
+++ b/conf.default/config.xml
@@ -718,21 +718,21 @@
<monitor_type>
<name>ICMP</name>
<type>icmp</type>
- <desc>ICMP</desc>
+ <descr>ICMP</descr>
<options>
</options>
</monitor_type>
<monitor_type>
<name>TCP</name>
<type>tcp</type>
- <desc>Generic TCP</desc>
+ <descr>Generic TCP</descr>
<options>
</options>
</monitor_type>
<monitor_type>
<name>HTTP</name>
<type>http</type>
- <desc>Generic HTTP</desc>
+ <descr>Generic HTTP</descr>
<options>
<path>/</path>
<host/>
@@ -742,7 +742,7 @@
<monitor_type>
<name>HTTPS</name>
<type>https</type>
- <desc>Generic HTTPS</desc>
+ <descr>Generic HTTPS</descr>
<options>
<path>/</path>
<host/>
@@ -752,7 +752,7 @@
<monitor_type>
<name>SMTP</name>
<type>send</type>
- <desc>Generic SMTP</desc>
+ <descr>Generic SMTP</descr>
<options>
<send>EHLO nosuchhost</send>
<expect>250-</expect>
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index a18e1bb..fcb9026 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -89,7 +89,7 @@ $g = array(
"disablehelpmenu" => false,
"disablehelpicon" => false,
"debug" => false,
- "latest_config" => "7.2",
+ "latest_config" => "7.3",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "105",
"minimum_ram_warning_text" => "128 MB",
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index f21146d..f4f8bb6 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -857,7 +857,7 @@ function upgrade_045_to_046() {
$pool['type'] = 'server';
$pool['behaviour'] = 'balance';
$pool['name'] = "{$vs_a[$i]['name']}-sitedown";
- $pool['desc'] = "Sitedown pool for VS: {$vs_a[$i]['name']}";
+ $pool['descr'] = "Sitedown pool for VS: {$vs_a[$i]['name']}";
$pool['port'] = $pools[$vs_a[$i]['pool']]['port'];
$pool['servers'] = array();
$pool['servers'][] = $vs_a[$i]['sitedown'];
@@ -1649,7 +1649,7 @@ function upgrade_053_to_054() {
foreach($lbpool_arr as $lbpool) {
if($lbpool['type'] == "gateway") {
$gateway_group['name'] = $lbpool['name'];
- $gateway_group['descr'] = $lbpool['desc'];
+ $gateway_group['descr'] = $lbpool['descr'];
$gateway_group['trigger'] = "down";
$gateway_group['item'] = array();
$i = 0;
@@ -2225,4 +2225,24 @@ function upgrade_071_to_072() {
}
}
}
+
+function desc_to_descr(& $section) {
+ if (is_array($section)) {
+ foreach($section as & $item) {
+ if (!empty($item['desc'])) {
+ $item['descr'] = $item['desc'];
+ unset($item['desc']);
+ }
+ }
+ }
+}
+
+function upgrade_072_to_073() {
+ global $config;
+ desc_to_descr($config['load_balancer']['monitor_type']);
+ desc_to_descr($config['load_balancer']['lbpool']);
+ desc_to_descr($config['load_balancer']['lbaction']);
+ desc_to_descr($config['load_balancer']['lbprotocol']);
+ desc_to_descr($config['load_balancer']['virtual_server']);
+}
?>
diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php
index 987192c..5ed82e5 100755
--- a/usr/local/www/load_balancer_monitor.php
+++ b/usr/local/www/load_balancer_monitor.php
@@ -121,7 +121,7 @@ include("head.inc");
$t->my_uri('load_balancer_monitor.php');
$t->add_column(gettext('Name'),'name',20);
$t->add_column(gettext('Type'),'type',10);
- $t->add_column(gettext('Description'),'desc',30);
+ $t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_monitor_edit.php b/usr/local/www/load_balancer_monitor_edit.php
index 6c9a53c..6156c65 100755
--- a/usr/local/www/load_balancer_monitor_edit.php
+++ b/usr/local/www/load_balancer_monitor_edit.php
@@ -54,7 +54,7 @@ else
if (isset($id) && $a_monitor[$id]) {
$pconfig['name'] = $a_monitor[$id]['name'];
$pconfig['type'] = $a_monitor[$id]['type'];
- $pconfig['desc'] = $a_monitor[$id]['desc'];
+ $pconfig['descr'] = $a_monitor[$id]['descr'];
$pconfig['options'] = array();
$pconfig['options'] = $a_monitor[$id]['options'];
} else {
@@ -84,7 +84,7 @@ if ($_POST) {
}
/* input validation */
- $reqdfields = explode(" ", "name type desc");
+ $reqdfields = explode(" ", "name type descr");
$reqdfieldsn = array(gettext("Name"),gettext("Type"),gettext("Description"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
@@ -143,7 +143,7 @@ if ($_POST) {
update_if_changed("name", $monent['name'], $pconfig['name']);
update_if_changed("type", $monent['type'], $pconfig['type']);
- update_if_changed("description", $monent['desc'], $pconfig['desc']);
+ update_if_changed("description", $monent['descr'], $pconfig['descr']);
if($pconfig['type'] == "http" || $pconfig['type'] == "https" ) {
/* log updates, then clear array and reassign - dumb, but easiest way to have a clear array */
update_if_changed("path", $monent['options']['path'], $pconfig['options']['path']);
@@ -237,7 +237,7 @@ function updateType(t){
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64">
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
<tr align="left">
diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php
index cd6e2a6..fcd0f72 100755
--- a/usr/local/www/load_balancer_pool.php
+++ b/usr/local/www/load_balancer_pool.php
@@ -133,7 +133,7 @@ include("head.inc");
$t->add_column(gettext('Servers'),'servers',15);
$t->add_column(gettext('Port'),'port',10);
$t->add_column(gettext('Monitor'),'monitor',10);
- $t->add_column(gettext('Description'),'desc',25);
+ $t->add_column(gettext('Description'),'descr',25);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php
index 92453b9..e37f51c 100755
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -54,7 +54,7 @@ else
if (isset($id) && $a_pool[$id]) {
$pconfig['name'] = $a_pool[$id]['name'];
$pconfig['mode'] = $a_pool[$id]['mode'];
- $pconfig['desc'] = $a_pool[$id]['desc'];
+ $pconfig['descr'] = $a_pool[$id]['descr'];
$pconfig['port'] = $a_pool[$id]['port'];
$pconfig['servers'] = &$a_pool[$id]['servers'];
$pconfig['serversdisabled'] = &$a_pool[$id]['serversdisabled'];
@@ -112,7 +112,7 @@ if ($_POST) {
update_if_changed("name", $poolent['name'], $_POST['name']);
update_if_changed("mode", $poolent['mode'], $_POST['mode']);
- update_if_changed("description", $poolent['desc'], $_POST['desc']);
+ update_if_changed("description", $poolent['descr'], $_POST['descr']);
update_if_changed("port", $poolent['port'], $_POST['port']);
update_if_changed("servers", $poolent['servers'], $_POST['servers']);
update_if_changed("serversdisabled", $poolent['serversdisabled'], $_POST['serversdisabled']);
@@ -184,7 +184,7 @@ function clearcombo(){
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64">
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
diff --git a/usr/local/www/load_balancer_relay_action.php b/usr/local/www/load_balancer_relay_action.php
index 73e201d..c3c7f2b 100755
--- a/usr/local/www/load_balancer_relay_action.php
+++ b/usr/local/www/load_balancer_relay_action.php
@@ -140,7 +140,7 @@ include("head.inc");
$t->add_column(gettext('Name'),'name',20);
$t->add_column(gettext('Type'),'type',10);
$t->add_column(gettext('Options'),'options',30);
- $t->add_column(gettext('Description'),'desc',30);
+ $t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_relay_action_edit.php b/usr/local/www/load_balancer_relay_action_edit.php
index 4a1a1a9..667a0af 100755
--- a/usr/local/www/load_balancer_relay_action_edit.php
+++ b/usr/local/www/load_balancer_relay_action_edit.php
@@ -113,7 +113,7 @@ if ($_POST) {
unset($pconfig["type_{$pconfig['direction']}"]);
/* input validation */
- $reqdfields = explode(" ", "name protocol direction action desc");
+ $reqdfields = explode(" ", "name protocol direction action descr");
$reqdfieldsn = array(gettext("Name"),gettext("Protocol"),gettext("Direction"),gettext("Action"),gettext("Description"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
@@ -135,7 +135,7 @@ if ($_POST) {
update_if_changed("protocol", $actent['protocol'], $pconfig['protocol']);
update_if_changed("type", $actent['type'], $pconfig['type']);
update_if_changed("direction", $actent['direction'], $pconfig['direction']);
- update_if_changed("description", $actent['desc'], $pconfig['desc']);
+ update_if_changed("description", $actent['descr'], $pconfig['descr']);
update_if_changed("action", $actent['action'], $pconfig['action']);
switch ($pconfig['action']) {
case "append":
@@ -414,7 +414,7 @@ document.observe("dom:loaded", function() {
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64">
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
<!-- Protocol -->
diff --git a/usr/local/www/load_balancer_relay_protocol.php b/usr/local/www/load_balancer_relay_protocol.php
index 6710dea..f989c2a 100755
--- a/usr/local/www/load_balancer_relay_protocol.php
+++ b/usr/local/www/load_balancer_relay_protocol.php
@@ -134,7 +134,7 @@ include("head.inc");
$t->add_column(gettext('Name'),'name',20);
$t->add_column(gettext('Type'),'type',10);
$t->add_column(gettext('Options'),'options',30);
- $t->add_column(gettext('Description'),'desc',30);
+ $t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_relay_protocol_edit.php b/usr/local/www/load_balancer_relay_protocol_edit.php
index 95e07ab..ecd8ce4 100755
--- a/usr/local/www/load_balancer_relay_protocol_edit.php
+++ b/usr/local/www/load_balancer_relay_protocol_edit.php
@@ -54,7 +54,7 @@ else
if (isset($id) && $a_protocol[$id]) {
$pconfig = $a_protocol[$id];
$pconfig['type'] = $a_protocol[$id]['type'];
- $pconfig['desc'] = $a_protocol[$id]['desc'];
+ $pconfig['descr'] = $a_protocol[$id]['descr'];
$pconfig['lbaction'] = array();
$pconfig['options'] = $a_protocol[$id]['options'];
} else {
@@ -75,7 +75,7 @@ if ($_POST) {
/* input validation */
- $reqdfields = explode(" ", "name type desc");
+ $reqdfields = explode(" ", "name type descr");
$reqdfieldsn = array(gettext("Name"),gettext("Type"),gettext("Description"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
@@ -103,7 +103,7 @@ if ($_POST) {
update_if_changed(gettext("name"), $protent['name'], $pconfig['name']);
update_if_changed(gettext("type"), $protent['type'], $pconfig['type']);
- update_if_changed(gettext("description"), $protent['desc'], $pconfig['desc']);
+ update_if_changed(gettext("description"), $protent['descr'], $pconfig['descr']);
update_if_changed(gettext("type"), $protent['type'], $pconfig['type']);
update_if_changed(gettext("action"), $protent['lbaction'], $pconfig['lbaction']);
@@ -214,7 +214,7 @@ document.observe('dom:loaded', function(){
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64">
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
<tr>
diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php
index 82904b5..69ea9a4 100755
--- a/usr/local/www/load_balancer_virtual_server.php
+++ b/usr/local/www/load_balancer_virtual_server.php
@@ -131,7 +131,7 @@ include("head.inc");
$t->add_column(gettext('Port'),'port',10);
$t->add_column(gettext('Pool'),'pool',15);
$t->add_column(gettext('Fall Back Pool'),'sitedown',15);
- $t->add_column(gettext('Description'),'desc',30);
+ $t->add_column(gettext('Description'),'descr',30);
$t->add_button('edit');
$t->add_button('dup');
$t->add_button('del');
diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php
index 0f1fe20..4cbf0e2 100755
--- a/usr/local/www/load_balancer_virtual_server_edit.php
+++ b/usr/local/www/load_balancer_virtual_server_edit.php
@@ -101,7 +101,7 @@ if ($_POST) {
$changedesc .= " " . sprintf(gettext("created '%s' vs:"), $_POST['name']);
update_if_changed("name", $vsent['name'], $_POST['name']);
- update_if_changed("desc", $vsent['desc'], $_POST['desc']);
+ update_if_changed("descr", $vsent['descr'], $_POST['descr']);
update_if_changed("pool", $vsent['pool'], $_POST['pool']);
update_if_changed("port", $vsent['port'], $_POST['port']);
update_if_changed("sitedown", $vsent['sitedown'], $_POST['sitedown']);
@@ -185,7 +185,7 @@ document.observe("dom:loaded", function() {
<tr align="left">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64">
+ <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64">
</td>
</tr>
<tr align="left">
diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php
index e812fca..16f474b 100755
--- a/usr/local/www/status_lb_pool.php
+++ b/usr/local/www/status_lb_pool.php
@@ -221,7 +221,7 @@ if ($_POST) {
<?php echo $pool['monitor']; ?>
</td>
<td class="listbg" >
- <?=$pool['desc'];?>
+ <?=$pool['descr'];?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php
index cec75ce..bab9976 100755
--- a/usr/local/www/status_lb_vs.php
+++ b/usr/local/www/status_lb_vs.php
@@ -176,7 +176,7 @@ include("head.inc");
<table border="0" cellpadding="3" cellspacing="2"><tr><td bgcolor="<?=$bgcolor?>"> <?=$rdr_a[$vsent['name']]['status']?> </td></tr></table>
</td>
<td class="listbg" >
- <?=$vsent['desc'];?>
+ <?=$vsent['descr'];?>
</td>
</tr>
<?php $i++; endforeach; ?>
diff --git a/usr/local/www/widgets/widgets/load_balancer_status.widget.php b/usr/local/www/widgets/widgets/load_balancer_status.widget.php
index 25ce170..c1cf979 100644
--- a/usr/local/www/widgets/widgets/load_balancer_status.widget.php
+++ b/usr/local/www/widgets/widgets/load_balancer_status.widget.php
@@ -130,7 +130,7 @@ require_once("functions.inc");
</table>
</td>
<td class="listbg" >
- <font color="#FFFFFF"><?=$vipent['desc'];?></font>
+ <font color="#FFFFFF"><?=$vipent['descr'];?></font>
</td>
</tr>
<?php $i++; endforeach; ?>
OpenPOWER on IntegriCloud