diff options
author | Ermal <eri@pfsense.org> | 2010-09-16 16:49:38 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-09-16 16:49:38 +0000 |
commit | ef05ae5f7882e0783e13bfed9d32fbe620ced641 (patch) | |
tree | 53fcb5a34eabcd5ff8f36818c63466034b0026ba | |
parent | 7ec17767bf222e8fbcdb854c291372d119c1d50d (diff) | |
download | pfsense-ef05ae5f7882e0783e13bfed9d32fbe620ced641.zip pfsense-ef05ae5f7882e0783e13bfed9d32fbe620ced641.tar.gz |
Actually display a the right class for static gateways. Also fix whitespace
-rw-r--r-- | etc/inc/gwlb.inc | 17 | ||||
-rwxr-xr-x | usr/local/www/system_gateways.php | 34 |
2 files changed, 24 insertions, 27 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 66014ff..43f7e20 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -270,16 +270,9 @@ function return_gateways_array($disabled = false) { $gateways_arr = array(); - /* Loop through all interfaces with a gateway and add it to a array */ - if ($disabled == false) { - $iflist = get_configured_interface_with_descr(); - } else { - $iflist = get_configured_interface_with_descr(false, true); - } - $i = 0; /* Process/add all the configured gateways. */ - if(is_array($config['gateways']['gateway_item'])) { + if (is_array($config['gateways']['gateway_item'])) { foreach($config['gateways']['gateway_item'] as $gateway) { if($gateway['gateway'] == "dynamic") { $gateway['gateway'] = get_interface_gateway($gateway['interface']); @@ -301,6 +294,12 @@ function return_gateways_array($disabled = false) { } } + /* Loop through all interfaces with a gateway and add it to a array */ + if ($disabled == false) + $iflist = get_configured_interface_with_descr(); + else + $iflist = get_configured_interface_with_descr(false, true); + /* Process/add dynamic gateways. */ foreach($iflist as $ifname => $friendly ) { if(! interface_has_gateway($ifname)) @@ -311,7 +310,7 @@ function return_gateways_array($disabled = false) { $gateway['gateway'] = get_interface_gateway($ifname, $gateway['dynamic']); $gateway['interface'] = get_real_interface($ifname); $gateway['friendlyiface'] = $ifname; - $gateway['name'] = "{$friendly}"; + $gateway['name'] = $friendly; $gateway['attribute'] = "system"; /* Loopback dummy for dynamic interfaces without a IP */ diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 0e3bc43..b39af37 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -166,33 +166,31 @@ include("head.inc"); <?php $i = 0; foreach ($a_gateways as $gateway): ?> <tr> <td class="listlr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> - <?php + <?php echo $gateway['name']; - if(isset($gateway['defaultgw'])) { + if(isset($gateway['defaultgw'])) echo " <strong>(default)<strong>"; - } - ?> - + ?> </td> <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> - <?php - echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface'])); - ?> + <?php + echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface'])); + ?> </td> <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> - <?php - echo $gateway['gateway'] . " "; - ?> + <?php + echo $gateway['gateway'] . " "; + ?> </td> <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> - <?php - echo htmlspecialchars($gateway['monitor']) . " "; - ?> + <?php + echo htmlspecialchars($gateway['monitor']) . " "; + ?> </td> - <?php if($gateway['attribute'] == "system") : ?> - <td class="listbgns" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> - <?php else : ?> + <?php if (is_numeric($gateway['attribute'])) : ?> <td class="listbg" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> + <?php else : ?> + <td class="listbgns" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';"> <?php endif; ?> <?=htmlspecialchars($gateway['descr']);?> </td> @@ -219,7 +217,7 @@ include("head.inc"); </table> </tr> - <?php $i++; endforeach; ?> + <?php $i++; endforeach; ?> <tr> <td class="list" colspan="5"></td> <td class="list"> |