summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Murphy <darren@victoriajd.com>2012-02-06 13:25:06 +0100
committerDarren Murphy <darren@victoriajd.com>2012-02-06 13:25:06 +0100
commit50333cf052a6fc2ed29f16639ac1d0c891978b38 (patch)
treea08327d125540b0131132af9648a5cfb0f312f03
parent8c8ed47542783991ed4639783607334f2e52bb70 (diff)
downloadsmokeping-50333cf052a6fc2ed29f16639ac1d0c891978b38.tar.gz
smokeping-50333cf052a6fc2ed29f16639ac1d0c891978b38.tar.xz
Add template support for http auth user
-rw-r--r--lib/Smokeping.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index bba6dca..b15880b 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1677,6 +1677,7 @@ sub display_webpage($$){
my $display_tree = $tree->{__tree_link} ? $tree->{__tree_link} : $tree;
+ my $authuser = $ENV{REMOTE_USER} || 'Guest';
my $page = fill_template
($cfg->{Presentation}{template},
{
@@ -1700,6 +1701,7 @@ sub display_webpage($$){
step => $step,
rrdlogo => '<A HREF="http://oss.oetiker.ch/rrdtool/"><img border="0" src="'.$cfg->{General}{imgurl}.'/rrdtool.png"></a>',
smokelogo => '<A HREF="http://oss.oetiker.ch/smokeping/counter.cgi/'.$VERSION.'"><img border="0" src="'.$cfg->{General}{imgurl}.'/smokeping.png"></a>',
+ authuser => $authuser,
}
);
my $expi = $cfg->{Database}{step} > 120 ? $cfg->{Database}{step} : 120;
@@ -3945,6 +3947,7 @@ sub gen_page ($$$) {
my $step = $probes->{$tree->{probe}}->step();
my $readversion = "?";
$VERSION =~ /(\d+)\.(\d{3})(\d{3})/ and $readversion = sprintf("%d.%d.%d",$1,$2,$3);
+ my $authuser = $ENV{REMOTE_USER} || 'Guest';
$page = fill_template
($cfg->{Presentation}{template},
{
@@ -3963,6 +3966,7 @@ sub gen_page ($$$) {
step => $step,
rrdlogo => '<A HREF="http://oss.oetiker.ch/rrdtool/"><img border="0" src="'.$cfg->{General}{imgurl}.'/rrdtool.png"></a>',
smokelogo => '<A HREF="http://oss.oetiker.ch/smokeping/counter.cgi/'.$VERSION.'"><img border="0" src="'.$cfg->{General}{imgurl}.'/smokeping.png"></a>',
+ authuser => $authuser,
});
print PAGEFILE $page || "<HTML><BODY>ERROR: Reading page template ".$cfg->{Presentation}{template}."</BODY></HTML>";