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.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.php')
-rwxr-xr-x | usr/local/www/system_routes.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index a9160c5..fc24962 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -47,11 +47,8 @@ require_once("shaper.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); $changedesc = "Static Routes: "; if ($_POST) { @@ -92,6 +89,7 @@ if ($_POST) { if ($_GET['act'] == "del") { if ($a_routes[$_GET['id']]) { $changedesc .= "removed route to " . $a_routes[$_GET['id']['route']]; + mwexec("/sbin/route delete " . escapeshellarg($a_routes[$_GET['id']]['network'])); unset($a_routes[$_GET['id']]); write_config($changedesc); mark_subsystem_dirty('staticroutes'); @@ -160,17 +158,12 @@ include("head.inc"); </td> <td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> <?php - echo $route['gateway'] . " "; + echo $a_gateways[$route['gateway']]['name'] . " "; ?> </td> <td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> <?php - foreach($a_gateways as $gateway) { - if($gateway['name'] == $route['gateway']) { - echo strtoupper($gateway['interface']) . " "; - } - } - + echo convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface']) . " "; ?> </td> <td class="listbg" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> |