#
#========================================================================
#
-# Version 2.1.0_CVS, released 8 Feb 2004.
+# Version 2.1.0beta0, released 20 Mar 2004.
#
# See http://backuppc.sourceforge.net.
#
$Privileged ||= $Conf{CgiAdminUsers} eq "*";
}
$PrivAdmin = $Privileged;
+ return $Privileged if ( !defined($host) );
+
$Privileged ||= $User eq $Hosts->{$host}{user};
$Privileged ||= defined($Hosts->{$host}{moreUsers}{$User});
-
return $Privileged;
}
#
sub GetUserHosts
{
- my($host, $getAll) = @_;
+ my($getAll) = @_;
my @hosts;
if ( $getAll && CheckPermission() ) {
sub Header
{
- my($title, $content, $noBrowse) = @_;
+ my($title, $content, $noBrowse, $contentSub, $contentPost) = @_;
my @adminLinks = (
{ link => "", name => $Lang->{Status},
priv => 1},
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>$title</title>
-$Conf{CSSstylesheet}
+<link rel=stylesheet type="text/css" href="$Conf{CgiImageDirURL}/$Conf{CgiCSSFile}" title="CSSFile">
$Conf{CgiHeaders}
</head><body onLoad="document.getElementById('NavMenu').style.height=document.body.scrollHeight">
<img src="$Conf{CgiImageDirURL}/logo.gif" hspace="5" vspace="7"><br>
NavLink("?action=view&type=config&host=${EscURI($host)}",
$Lang->{Config_file}, " class=\"navbar\"");
}
- print <<EOF;
-</div>
-<div id="Content">
-$content
-<br><br><br>
-</div>
-<div class="NavMenu" style="height:100%" id="NavMenu">
-EOF
- } else {
- print <<EOF;
-<div id="Content">
-$content
+ print "</div>\n";
+ }
+ print("<div id=\"Content\">\n$content\n");
+ if ( defined($contentSub) && ref($contentSub) eq "CODE" ) {
+ while ( (my $s = &$contentSub()) ne "" ) {
+ print($s);
+ }
+ }
+ print($contentPost) if ( defined($contentPost) );
+ print <<EOF;
<br><br><br>
</div>
<div class="NavMenu" id="NavMenu" style="height:100%">
EOF
- }
- my $hostSelectbox = "<option value=\"#\">Select a host...</option>";
- my @hosts = GetUserHosts($In{host}, $Conf{CgiNavBarAdminAllHosts});
+ my $hostSelectbox = "<option value=\"#\">$Lang->{Select_a_host}</option>";
+ my @hosts = GetUserHosts($Conf{CgiNavBarAdminAllHosts});
if ( defined($Hosts) && %$Hosts > 0 && @hosts ) {
NavSectionTitle($Lang->{Hosts});
foreach my $host ( @hosts ) {