diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-02-10 16:08:07 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-02-10 16:08:07 +0100 |
commit | 2c1b25d68193117a555ae54c498e602993a1aa2c (patch) | |
tree | c68493d93e7a8caf678ea8b62880c6cc8cb2ad43 | |
parent | 9103d9ee6c46a3fd36f2dfb5cd624a8e6a5366a8 (diff) | |
parent | 0fc6be3f54db706ccc7cce8b19b12f88dec171fa (diff) | |
download | pfsense-2c1b25d68193117a555ae54c498e602993a1aa2c.zip pfsense-2c1b25d68193117a555ae54c498e602993a1aa2c.tar.gz |
Merge remote branch 'upstream/master'
-rw-r--r-- | etc/inc/authgui.inc | 2 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 6 | ||||
-rw-r--r-- | etc/inc/shaper.inc | 37 | ||||
-rw-r--r-- | etc/pfSense.obsoletedfiles | 1 | ||||
-rwxr-xr-x | usr/local/www/crash_reporter.php | 8 | ||||
-rw-r--r-- | usr/local/www/firewall_shaper_vinterface.php | 27 | ||||
-rw-r--r-- | usr/local/www/status_filter_reload.php | 2 |
7 files changed, 60 insertions, 23 deletions
diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc index dc85357..650c7b9 100644 --- a/etc/inc/authgui.inc +++ b/etc/inc/authgui.inc @@ -233,7 +233,7 @@ if($config['virtualip']) { print_info_box(gettext("You are accessing this router by an IP address not configured locally, which may be forwarded by NAT or other means. <br/><br/>If you did not setup this forwarding, you may be the target of a man-in-the-middle attack.")); } ?> - <form id="iform" name="login_iform" method="post" autocomplete="off" action="<?=$_SERVER['SCRIPT_NAME'];?>"> + <form id="iform" name="login_iform" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>"> <h1></h1> <div id="inputerrors"><?=$_SESSION['Login_Error'];?></div> <p> diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 1365f05..54ca19f 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1689,9 +1689,9 @@ function version_compare_dates($a, $b) { if ((!$a_time) || (!$b_time)) { return FALSE; } else { - if ($a < $b) + if ($a_time < $b_time) return -1; - elseif ($a == $b) + elseif ($$a_time == $b_time) return 0; else return 1; @@ -1750,7 +1750,7 @@ function version_compare_numeric($a, $b) { } function pfs_version_compare($cur_time, $cur_text, $remote) { // First try date compare - $v = version_compare_dates($cur_time, $b); + $v = version_compare_dates($cur_time, $remote); if ($v === FALSE) { // If that fails, try to compare by string // Before anything else, simply test if the strings are equal diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 85bae2b..7e77502 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -967,8 +967,12 @@ class priq_queue { } function ReadConfig(&$q) { - if (isset($q['name'])) - $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 if (isset($q['name'])) + $this->SetQname($q['name']); if (isset($q['interface'])) $this->SetInterface($q['interface']); $this->SetBandwidth($q['bandwidth']); @@ -1100,7 +1104,10 @@ class priq_queue { $form .= "<tr>"; $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">"; $form .= "Queue Name</td><td width=\"78%\" class=\"vtable\">"; - $form .= "<input name=\"name\" type=\"text\" id=\"name\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\""; + $form .= "<input name=\"newname\" type=\"text\" id=\"newname\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\""; + $form .= htmlspecialchars($this->GetQname()); + $form .= "\">"; + $form .= "<input name=\"name\" type=\"hidden\" id=\"name\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\""; $form .= htmlspecialchars($this->GetQname()); $form .= "\">"; $form .= "<br /> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."; @@ -2877,7 +2884,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 +2996,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 +3179,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 +3257,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>"; diff --git a/etc/pfSense.obsoletedfiles b/etc/pfSense.obsoletedfiles index fe54ea8..a5857ce 100644 --- a/etc/pfSense.obsoletedfiles +++ b/etc/pfSense.obsoletedfiles @@ -48,3 +48,4 @@ /usr/local/www/system_usermanager_addcert.php /usr/local/pkg/routed/routed.inc /usr/local/pkg/routed/routed.xml +/usr/local/www/filter_log.inc
\ No newline at end of file diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 8b03936..b82589a 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -49,10 +49,8 @@ function upload_crash_report($files) { $post = array(); $counter = 0; foreach($files as $file) { - if(filesize($cf) < FILE_SIZE) { - $post["file{$counter}"] = "@{$file}"; - $counter++; - } + $post["file{$counter}"] = "@{$file}"; + $counter++; } $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); @@ -122,7 +120,7 @@ $crash_report_header .= "\nCrash report details:\n"; exit; } else { $crash_files = glob("/var/crash/*"); - $crash_reports .= $crash_report_header; + $crash_reports = $crash_report_header; if(is_array($crash_files)) { foreach($crash_files as $cf) { if(filesize($cf) < FILE_SIZE) { diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index 865f048..5222771 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -71,10 +71,12 @@ if ($_GET) { if ($_POST) { if ($_POST['name']) $qname = htmlspecialchars(trim($_POST['name'])); + else if ($_POST['newname']) + $qname = htmlspecialchars(trim($_POST['name'])); if ($_POST['pipe']) $pipe = htmlspecialchars(trim($_POST['pipe'])); else - $pipe = htmlspecialchars(trim($_POST['name'])); + $pipe = htmlspecialchars(trim($qname)); if ($_POST['parentqueue']) $parentqueue = htmlspecialchars(trim($_POST['parentqueue'])); } @@ -94,12 +96,25 @@ if ($_GET) { switch ($action) { case "delete": if ($queue) { - $queue->delete_queue(); - write_config(); - mark_subsystem_dirty('shaper'); + if (is_array($config['filter']['rule'])) { + foreach ($config['filter']['rule'] as $rule) { + if ($rule['dnpipe'] == $queue->GetNumber() || $rule['pdnpipe'] == $queue->GetNumber()) + $input_errors[] = gettext("This pipe/queue is referenced in filter rules, please remove references from there before deleteing."); + } + } + if (!$input_errors) { + $queue->delete_queue(); + write_config(); + mark_subsystem_dirty('shaper'); + header("Location: firewall_shaper_vinterface.php"); + exit; + } + $output_form .= $queue->build_form(); + } else { + $input_errors[] = gettext("No queue with name {$qname} was found!"); + $output_form .= "<p class=\"pgtitle\">" . $dn_default_shaper_msg."</p>"; + $dontshow = true; } - header("Location: firewall_shaper_vinterface.php"); - exit; break; case "resetall": foreach ($dummynet_pipe_list as $dn) diff --git a/usr/local/www/status_filter_reload.php b/usr/local/www/status_filter_reload.php index ddd57ca..d1e54a9 100644 --- a/usr/local/www/status_filter_reload.php +++ b/usr/local/www/status_filter_reload.php @@ -69,7 +69,7 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <br/> <a href="/status_filter_reload.php?reloadfilter=true"><input type="button" value="Reload Filter" id="reloadfilter"></a> -<?php if ($config["installedpackages"]["carpsettings"]["config"][0]["pfsyncpeerip"] != ""): ?> +<?php if (is_array($config["installedpackages"]["carpsettings"]["config"][0]) && $config["installedpackages"]["carpsettings"]["config"][0]["pfsyncpeerip"] != ""): ?> <a href="/status_filter_reload.php?syncfilter=true"><input type="button" value="Force Config Sync" id="syncfilter"></a> <? endif; ?> |