diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-04-28 21:17:27 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-04-28 21:17:27 -0600 |
commit | c3c2fd205b1563976a278bd11396d055d7818d27 (patch) | |
tree | ae0316ca6b0c8423c35fe22cfa1e8bcaf30cdd55 /usr/local/www/system_routes_edit.php | |
parent | 39c0be7b5f387dffa7cbbb3dff3f2be46e6b504f (diff) | |
parent | 1364604bb503b02e80240bda728e154394271b9c (diff) | |
download | pfsense-c3c2fd205b1563976a278bd11396d055d7818d27.zip pfsense-c3c2fd205b1563976a278bd11396d055d7818d27.tar.gz |
Merge branch 'master' into gettext
Resolved conflicts:
usr/local/www/system_advanced_firewall.php
usr/local/www/system_routes.php
usr/local/www/system_routes_edit.php
Diffstat (limited to 'usr/local/www/system_routes_edit.php')
-rwxr-xr-x | usr/local/www/system_routes_edit.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index b8e7fa0..3fce917 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -57,11 +57,9 @@ require("guiconfig.inc"); if (!is_array($config['staticroutes']['route'])) $config['staticroutes']['route'] = array(); -if (!is_array($config['gateways']['gateway_item'])) - $config['gateways']['gateway_item'] = array(); $a_routes = &$config['staticroutes']['route']; -$a_gateways = &$config['gateways']['gateway_item']; +$a_gateways = return_gateways_array(true); $id = $_GET['id']; if (isset($_POST['id'])) @@ -102,13 +100,7 @@ if ($_POST) { $input_errors[] = gettext("A valid destination network bit count must be specified."); } if ($_POST['gateway']) { - $match = false; - foreach($a_gateways as $gateway) { - if(in_array($_POST['gateway'], $gateway)) { - $match = true; - } - } - if(!$match) + if (!isset($a_gateways[$_POST['gateway']])) $input_errors[] = gettext("A valid gateway must be specified."); } @@ -177,11 +169,19 @@ include("head.inc"); <td width="78%" class="vtable"> <select name="gateway" id="gateway" class="formselect"> <?php - foreach ($a_gateways as $gateway): ?> - <option value="<?=$gateway['name'];?>" <?php if ($gateway['name'] == $pconfig['gateway']) echo "selected"; ?>> - <?=htmlspecialchars($gateway['name']);?> - </option> - <?php endforeach; ?> + foreach ($a_gateways as $gateway) { + if ($gateway['attribute'] == "system") { + echo "<option value='{$gateway['friendlyiface']}' "; + if ($gateway['friendlyiface'] == $pconfig['gateway']) + echo "selected"; + } else { + echo "<option value='{$gateway['name']}' "; + if ($gateway['name'] == $pconfig['gateway']) + echo "selected"; + } + echo ">" . htmlspecialchars($gateway['name']) . "</option>\n"; + } + ?> </select> <br /> <div id='addgwbox'> <?=gettext("Choose which gateway this route applies to or"); ?> <a OnClick="show_add_gateway();" href="#">add a new one</a>. |