summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-30 15:14:32 +0000
committerErmal <eri@pfsense.org>2010-09-30 15:14:32 +0000
commitbb849003af1824db6f89d5df1409e3d5ffe3e527 (patch)
tree273fa91e1b594a90c4ac47f56f052bfa46f96d8d /usr
parent9fd19334bf105ae1ad5604d4fea8cad48d3be293 (diff)
downloadpfsense-bb849003af1824db6f89d5df1409e3d5ffe3e527.zip
pfsense-bb849003af1824db6f89d5df1409e3d5ffe3e527.tar.gz
Initialize variable properly. Handle the case when the interfaces select box is disabled and it will not be posted(Reported-by: ghnb
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_gateways_edit.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index b9ea2fe..cc979a6 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -63,6 +63,7 @@ if (isset($_GET['dup'])) {
}
if (isset($id) && $a_gateways[$id]) {
+ $pconfig = array();
$pconfig['name'] = $a_gateways[$id]['name'];
$pconfig['weight'] = $a_gateways[$id]['weight'];
$pconfig['interface'] = $a_gateways[$id]['interface'];
@@ -222,8 +223,6 @@ if ($_POST) {
$gateway['descr'] = $_POST['descr'];
if (is_ipaddr($_POST['monitor']))
$gateway['monitor'] = $_POST['monitor'];
- else
- unset($gateway['monitor']);
if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") {
$i = 0;
@@ -233,8 +232,7 @@ if ($_POST) {
}
$gateway['defaultgw'] = true;
$reloadif = true;
- } else
- unset($gateway['defaultgw']);
+ }
if ($_POST['latencylow'])
$gateway['latencylow'] = $_POST['latencylow'];
@@ -315,8 +313,15 @@ function show_advanced_gateway() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
<td width="78%" class="vtable">
- <select name="interface" class="formselect" <?php if ($pconfig['dynamic'] == true && $pconfig['attribute'] == "system") echo "disabled"; ?>>
<?php
+ if ($pconfig['dynamic'] == true && $pconfig['attribute'] == "system")
+
+ if ($pconfig['dynamic'] == true && $pconfig['attribute'] == "system") {
+ echo "<input name='interface' type='hidden' value='{$pconfig['friendlyiface']}' />";
+ echo "<select name='interface' class='formselect' disabled >\n";
+ } else
+ echo "<select name='interface' class='formselect'>\n";
+
$interfaces = get_configured_interface_with_descr(false, true);
foreach ($interfaces as $iface => $ifacename) {
echo "<option value=\"{$iface}\"";
OpenPOWER on IntegriCloud