summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-02-09 21:40:00 +0000
committerErmal <eri@pfsense.org>2011-02-09 21:41:10 +0000
commit1cbe86f032a6dc1480c5b62d1d9a641a29105bac (patch)
treedd8caaf968d05c6fa5e5e2dd6b38378f0a1fe241 /etc
parentdabcf28c6af506268941d2612d738815247e9fb8 (diff)
downloadpfsense-1cbe86f032a6dc1480c5b62d1d9a641a29105bac.zip
pfsense-1cbe86f032a6dc1480c5b62d1d9a641a29105bac.tar.gz
Fixes #1207. Allow renaming a limiter. Also prevent a limiter to be deleted if it is referenced in filter rules.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/shaper.inc24
1 files changed, 20 insertions, 4 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 85bae2b..6734f80 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -2877,7 +2877,13 @@ class dnpipe_class extends dummynet_class {
}
function ReadConfig(&$q) {
- $this->SetQname($q['name']);
+ if (!empty($q['name']) && !empty($q['newname']) && $q['name'] != $q['newname']) {
+ $this->SetQname($q['newname']);
+ } else if (!empty($q['newname'])) {
+ $this->SetQname($q['newname']);
+ } else {
+ $this->SetQname($q['name']);
+ }
$this->SetNumber($q['number']);
if (isset($q['bandwidth']) && $q['bandwidth'] <> "") {
$this->SetBandwidth($q['bandwidth']);
@@ -2983,7 +2989,9 @@ class dnpipe_class extends dummynet_class {
$form .= "</td></tr>";
$form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
- $form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
+ $form .= "<input type=\"text\" id=\"newname\" name=\"newname\" value=\"";
+ $form .= $this->GetQname()."\">";
+ $form .= "<input type=\"hidden\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
$form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth";
@@ -3164,7 +3172,13 @@ class dnqueue_class extends dummynet_class {
}
function ReadConfig(&$q) {
- $this->SetQname($q['name']);
+ if (!empty($q['name']) && !empty($q['newname']) && $q['name'] != $q['newname']) {
+ $this->SetQname($q['newname']);
+ } else if (!empty($q['newname'])) {
+ $this->SetQname($q['newname']);
+ } else {
+ $this->SetQname($q['name']);
+ }
$this->SetNumber($q['number']);
if (isset($q['qlimit']) && $q['qlimit'] <> "")
$this->SetQlimit($q['qlimit']);
@@ -3236,7 +3250,9 @@ class dnqueue_class extends dummynet_class {
$form .= "</td></tr>";
$form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
- $form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
+ $form .= "<input type=\"text\" id=\"newname\" name=\"newname\" value=\"";
+ $form .= $this->GetQname()."\">";
+ $form .= "<input type=\"hidden\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
$form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>";
OpenPOWER on IntegriCloud