From 96d1d4adeeaf7d4b69f55ffa5e72bf5f3feaf160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Mon, 18 Feb 2008 20:51:08 +0000 Subject: Do not allow a user to add or remove childs on a default queue. Better prevent them from doing this than dealing with other situarions. --- usr/local/www/firewall_shaper.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'usr/local/www/firewall_shaper.php') diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 04585d1..c85966a 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -79,9 +79,12 @@ if ($interface) { $can_enable = true; else $can_enable = false; - if ($queue->CanHaveChilds() && $can_enable) - $can_add = true; - else + if ($queue->CanHaveChilds() && $can_enable) { + if ($queue->GetDefault() <> "") + $can_add = false; + else + $can_add = true; + } else $can_add = false; } } else $addnewaltq = true; @@ -234,7 +237,10 @@ if ($_GET) { write_config(); touch($d_shaperconfdirty_path); $can_enable = true; - $can_add = true; + if ($queue->GetDefault() <> "") + $can_add = false; + else + $can_add = true; } $output_form .= $altq->build_form(); @@ -248,15 +254,21 @@ if ($_GET) { array_pop($tmppath); $tmp->wconfig(); $can_enable = true; - if ($tmp->CanHaveChilds() && $can_enable) - $can_add = true; - else + if ($tmp->CanHaveChilds() && $can_enable) { + if ($queue->GetDefault() <> "") + $can_add = false; + else + $can_add = true; + } else $can_add = false; write_config(); touch($d_shaperconfdirty_path); $can_enable = true; if ($altq->GetScheduler() != "PRIQ") /* XXX */ - $can_add = true; + if ($queue->GetDefault() <> "") + $can_add = false; + else + $can_add = true; } $output_form .= $tmp->build_form(); } else -- cgit v1.1