aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailreport
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-07-27 14:55:38 -0400
committerjim-p <jimp@pfsense.org>2011-07-27 14:55:38 -0400
commitf4a2b3e843a72e4b62c54bc5da4ef4f3c568bd89 (patch)
tree202f141eb0bf19fec02fe0f5728a251aa09c00d0 /config/mailreport
parent060d043124f5cf83875e2cece7be9d76294e7cab (diff)
downloadpfsense-packages-f4a2b3e843a72e4b62c54bc5da4ef4f3c568bd89.tar.gz
pfsense-packages-f4a2b3e843a72e4b62c54bc5da4ef4f3c568bd89.tar.bz2
pfsense-packages-f4a2b3e843a72e4b62c54bc5da4ef4f3c568bd89.zip
Respect the user-defined interface names in e-mailed RRD graphs, and in drop-downs for building reports.
Diffstat (limited to 'config/mailreport')
-rw-r--r--config/mailreport/mail_reports.inc18
-rw-r--r--config/mailreport/status_mail_report_add_graph.php13
-rw-r--r--config/mailreport/status_mail_report_edit.php12
3 files changed, 23 insertions, 20 deletions
diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc
index dc8026cc..d94631cc 100644
--- a/config/mailreport/mail_reports.inc
+++ b/config/mailreport/mail_reports.inc
@@ -301,16 +301,14 @@ function mail_report_generate_graph($database, $style, $graph, $start, $end) {
// log_error("start $start, end $end, archivestart $archivestart, average $average, scale $scale, seconds $seconds");
/* Deduce a interface if possible and use the description */
- $curif = split("-", $curdatabase);
- $curif = "$curif[0]";
- $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif));
- if($friendly == "") {
- $friendly = $curif;
+ $curif = explode("-", $curdatabase);
+ $curif[1] = str_replace(".rrd", "", $curif[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif[0]));
+ if(!empty($friendly)) {
+ $curif[0] = $friendly;
}
- $search = array("-", ".rrd", $curif);
- $replace = array(" :: ", "", $friendly);
- $prettydb = ucwords(str_replace($search, $replace, $curdatabase));
-
+ $prettydb = ucwords(implode(" :: ", $curif));
+ $curif = $curif[0];
$rrddbpath = "/var/db/rrd/";
$rrdtmppath = "/tmp/";
@@ -1200,4 +1198,4 @@ function timeDiff($time, $opt = array()) {
return $str;
}
-?> \ No newline at end of file
+?>
diff --git a/config/mailreport/status_mail_report_add_graph.php b/config/mailreport/status_mail_report_add_graph.php
index 17d7731c..c0287367 100644
--- a/config/mailreport/status_mail_report_add_graph.php
+++ b/config/mailreport/status_mail_report_add_graph.php
@@ -183,12 +183,15 @@ include("head.inc");
<select name="graph" class="formselect" style="z-index: -10;">
<?php
foreach ($custom_databases as $db => $database) {
- $optionc = split("-", $database);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
+ $optionc = explode("-", $database);
+ $optionc[1] = str_replace(".rrd", "", $optionc[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc[0]));
+ if(!empty($friendly)) {
+ $optionc[0] = $friendly;
+ }
+ $prettyprint = ucwords(implode(" :: ", $optionc));
echo "<option value=\"{$database}\"";
- $prettyprint = ucwords(str_replace($search, $replace, $database));
- if($pconfig['graph'] == $database) {
+ if ($pconfig['graph'] == $database) {
echo " selected";
}
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
diff --git a/config/mailreport/status_mail_report_edit.php b/config/mailreport/status_mail_report_edit.php
index fe9a5194..3102e958 100644
--- a/config/mailreport/status_mail_report_edit.php
+++ b/config/mailreport/status_mail_report_edit.php
@@ -138,7 +138,6 @@ if ($_POST) {
set_mail_report_cron_jobs($a_mailreports);
write_config();
configure_cron();
-
header("Location: status_mail_report.php");
exit;
}
@@ -239,10 +238,13 @@ include("head.inc");
<?php endif; ?>
</tr>
<?php $i = 0; foreach ($a_graphs as $graph):
- $optionc = split("-", $graph['graph']);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
- $prettyprint = ucwords(str_replace($search, $replace, $graph['graph']));
+ $optionc = explode("-", $graph['graph']);
+ $optionc[1] = str_replace(".rrd", "", $optionc[1]);
+ $friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc[0]));
+ if(!empty($friendly)) {
+ $optionc[0] = $friendly;
+ }
+ $prettyprint = ucwords(implode(" :: ", $optionc));
?>
<tr ondblclick="document.location='status_mail_report_edit.php?id=<?=$i;?>'">
<td class="listlr"><?php echo $prettyprint; ?></td>