diff options
author | Ermal <eri@pfsense.org> | 2010-04-28 23:16:42 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-04-28 23:17:04 +0000 |
commit | a529acedfb8cb1407b5aee5c3d771c596a6662d5 (patch) | |
tree | 2b26d8230c2a720296386b4cb1794de03218a9cc /usr/local/www/system_routes_edit.php | |
parent | df6df70fd0aa2c39018b28e2f29a5dc01113237c (diff) | |
download | pfsense-a529acedfb8cb1407b5aee5c3d771c596a6662d5.zip pfsense-a529acedfb8cb1407b5aee5c3d771c596a6662d5.tar.gz |
Ticket #507. Do not remove all static routes to readd them back. The change will never delete a rule but define the action to be taken on it, either add or change a present route. Be consinstent on gateways allowed to be selected as destinations for static routes, including dynamic gateways.
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 434bbbc..7a46e5a 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'])) @@ -99,13 +97,7 @@ if ($_POST) { $input_errors[] = "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[] = "A valid gateway must be specified."; } @@ -174,11 +166,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'> Choose which gateway this route applies to or <a OnClick="show_add_gateway();" href="#">add a new one</a>. |