From 50333cf052a6fc2ed29f16639ac1d0c891978b38 Mon Sep 17 00:00:00 2001 From: Darren Murphy Date: Mon, 6 Feb 2012 20:25:06 +0800 Subject: Add template support for http auth user --- lib/Smokeping.pm | 4 ++++ 1 file changed, 4 insertions(+) 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 => '', smokelogo => '', + 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 => '', smokelogo => '', + authuser => $authuser, }); print PAGEFILE $page || "ERROR: Reading page template ".$cfg->{Presentation}{template}.""; -- cgit v1.2.3-24-g4f1b