From 96ef7db0312e76540fffda7092df4be9d97dfe6e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 26 Nov 2013 18:41:44 -0200 Subject: [PATCH] Add an option to disable gateway items --- usr/local/www/system_gateways_edit.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index fb9d8d71b1..2413b53fe3 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -42,7 +42,7 @@ require("guiconfig.inc"); require("pkg-utils.inc"); -$a_gateways = return_gateways_array(true); +$a_gateways = return_gateways_array(true, false, true); $a_gateways_arr = array(); foreach($a_gateways as $gw) { $a_gateways_arr[] = $gw; @@ -84,6 +84,7 @@ if (isset($id) && $a_gateways[$id]) { $pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']); $pconfig['descr'] = $a_gateways[$id]['descr']; $pconfig['attribute'] = $a_gateways[$id]['attribute']; + $pconfig['disabled'] = isset($a_gateways[$id]['disabled']); } if (isset($_GET['dup'])) { @@ -424,6 +425,11 @@ if ($_POST) { if ($_POST['down']) $gateway['down'] = $_POST['down']; + if(isset($_POST['disabled'])) + $gateway['disabled'] = true; + else + unset($gateway['disabled']); + /* when saving the manual gateway we use the attribute which has the corresponding id */ if (isset($realid) && $a_gateway_item[$realid]) $a_gateway_item[$realid] = $gateway; @@ -494,6 +500,14 @@ function monitor_change() { + + + + /> +
+ + +