summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2012-03-02 23:02:22 +0200
committerWarren Baker <warren@decoy.co.za>2012-03-02 23:02:22 +0200
commitbfe407e5a2184d0cceeb2349eb1408b4f28029eb (patch)
tree1e8dc53959f486f77b56199b70a7f4ebcdf569ba /usr
parent3b8a17a1d060482cb2425c62418cd37445762226 (diff)
downloadpfsense-bfe407e5a2184d0cceeb2349eb1408b4f28029eb.zip
pfsense-bfe407e5a2184d0cceeb2349eb1408b4f28029eb.tar.gz
Add the ability to disable static routes without deleting them
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_routes.php17
-rwxr-xr-xusr/local/www/system_routes_edit.php13
2 files changed, 27 insertions, 3 deletions
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php
index 64484a7..e4a36fb 100755
--- a/usr/local/www/system_routes.php
+++ b/usr/local/www/system_routes.php
@@ -60,7 +60,7 @@ if ($_POST) {
$retval = 0;
if (file_exists("{$g['tmp_path']}/.system_routes.apply")) {
- $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.system_routes.apply"));
+ $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.system_routes.apply"));
foreach ($toapplylist as $toapply)
mwexec("{$toapply}");
@@ -138,21 +138,32 @@ include("head.inc");
</tr>
<tr>
<?php $i = 0; foreach ($a_routes as $route): ?>
+ <?php
+ if (isset($route['disabled'])) {
+ $textss = "<span class=\"gray\">";
+ $textse = "</span>";
+ } else
+ $textss = $textse = "";
+ ?>
<td class="listlr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
- <?=strtolower($route['network']);?>
+ <?=$textss;?><?=strtolower($route['network']);?><?=$textse;?>
</td>
<td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
+ <?=$textss;?>
<?php
echo htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway']);
?>
+ <?=$textse;?>
</td>
<td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
+ <?=$textss;?>
<?php
echo convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface']) . " ";
?>
+ <?=$textse;?>
</td>
<td class="listbg" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($route['descr']);?>&nbsp;
+ <?=$textss;?><?=htmlspecialchars($route['descr']);?>&nbsp;<?=$textse;?>
</td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index cf38206..3bce554 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -73,6 +73,7 @@ if (isset($id) && $a_routes[$id]) {
explode('/', $a_routes[$id]['network']);
$pconfig['gateway'] = $a_routes[$id]['gateway'];
$pconfig['descr'] = $a_routes[$id]['descr'];
+ $pconfig['disabled'] = isset($a_routes[$id]['disabled']);
}
if (isset($_GET['dup']))
@@ -130,6 +131,10 @@ if ($_POST) {
$route['network'] = $osn;
$route['gateway'] = $_POST['gateway'];
$route['descr'] = $_POST['descr'];
+ if ($_POST['disabled'])
+ $route['disabled'] = true;
+ else
+ unset($route['disabled']);
if (!isset($id))
$id = count($a_routes);
@@ -264,6 +269,14 @@ include("head.inc");
</div>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Disabled");?></td>
+ <td width="78%" class="vtable">
+ <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
+ <strong><?=gettext("Disable this static route");?></strong><br />
+ <span class="vexpl"><?=gettext("Set this option to disable this static route without removing it from the list.");?></span>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
OpenPOWER on IntegriCloud