diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-01-06 14:10:47 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-01-06 14:11:14 -0200 |
commit | 81f1947666ebbe19f1f6579a1e5293c42c6d1c04 (patch) | |
tree | df8d45ce2c8862eca85177a09c4f8df69c19f849 /usr | |
parent | 30e2adbc04d37bf66bd4e0cce675d12fd3120f5a (diff) | |
download | pfsense-81f1947666ebbe19f1f6579a1e5293c42c6d1c04.zip pfsense-81f1947666ebbe19f1f6579a1e5293c42c6d1c04.tar.gz |
Add an option to force a gateway to be down, it fixes #2847
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/status_gateways.php | 5 | ||||
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 11 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/gateways.widget.php | 5 |
3 files changed, 19 insertions, 2 deletions
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index e7154a8..ffe1458 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -115,7 +115,10 @@ include("head.inc"); <?php if ($gateways_status[$gname]) { $status = $gateways_status[$gname]; - if (stristr($status['status'], "down")) { + if (stristr($status['status'], "force_down")) { + $online = gettext("Offline (forced)"); + $bgcolor = "#F08080"; // lightcoral + } elseif (stristr($status['status'], "down")) { $online = gettext("Offline"); $bgcolor = "#F08080"; // lightcoral } elseif (stristr($status['status'], "loss")) { diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 1911921..429e4cc 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -75,6 +75,7 @@ if (isset($id) && $a_gateways[$id]) { $pconfig['dynamic'] = true; $pconfig['gateway'] = $a_gateways[$id]['gateway']; $pconfig['defaultgw'] = isset($a_gateways[$id]['defaultgw']); + $pconfig['force_down'] = isset($a_gateways[$id]['force_down']); $pconfig['latencylow'] = $a_gateways[$id]['latencylow']; $pconfig['latencyhigh'] = $a_gateways[$id]['latencyhigh']; $pconfig['losslow'] = $a_gateways[$id]['losslow']; @@ -388,6 +389,8 @@ if ($_POST) { $gateway['descr'] = $_POST['descr']; if ($_POST['monitor_disable'] == "yes") $gateway['monitor_disable'] = true; + if ($_POST['force_down'] == "yes") + $gateway['force_down'] = true; if (is_ipaddr($_POST['monitor'])) $gateway['monitor'] = $_POST['monitor']; @@ -596,6 +599,14 @@ function monitor_change() { </td> </tr> <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Mark Gateway as Down"); ?></td> + <td width="78%" class="vtable"> + <input name="force_down" type="checkbox" id="force_down" value="yes" <?php if ($pconfig['force_down'] == true) echo "checked=\"checked\""; ?> /> + <strong><?=gettext("Mark Gateway as Down"); ?></strong><br /> + <?=gettext("This will force this gateway to be considered Down"); ?> + </td> + </tr> + <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Advanced");?></td> <td width="78%" class="vtable"> <?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && ($pconfig['interval'] > $apinger_default['interval'])) || (isset($pconfig['down']) && !($pconfig['down'] == $apinger_default['down']))); ?> diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php index b5bbe4f..52048a1 100644 --- a/usr/local/www/widgets/widgets/gateways.widget.php +++ b/usr/local/www/widgets/widgets/gateways.widget.php @@ -109,7 +109,10 @@ $counter = 1; <table border="0" cellpadding="0" cellspacing="2" style="table-layout: fixed;" summary="status"> <?php if ($gateways_status[$gname]) { - if (stristr($gateways_status[$gname]['status'], "down")) { + if (stristr($gateways_status[$gname]['status'], "force_down")) { + $online = "Offline (forced)"; + $bgcolor = "#F08080"; // lightcoral + } elseif (stristr($gateways_status[$gname]['status'], "down")) { $online = "Offline"; $bgcolor = "#F08080"; // lightcoral } elseif (stristr($gateways_status[$gname]['status'], "loss")) { |