X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FGeneralInfo.pm;h=472cb1b0c8ed08ba31752bb37ff73024c87d594d;hp=bb71e51857708acea0120d87e3c761283f360938;hb=5b3e6091d542c2e7445d5dd511cdf6e20aec8b8d;hpb=329e870f56fb6572fa697998d33676588034c149 diff --git a/lib/BackupPC/CGI/GeneralInfo.pm b/lib/BackupPC/CGI/GeneralInfo.pm index bb71e51..472cb1b 100644 --- a/lib/BackupPC/CGI/GeneralInfo.pm +++ b/lib/BackupPC/CGI/GeneralInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 3.0.0alpha, released 23 Jan 2006. # # See http://backuppc.sourceforge.net. # @@ -49,19 +49,20 @@ sub action my $startTime = timeStamp2($Jobs{$host}{startTime}); next if ( $host eq $bpc->trashJob && $Jobs{$host}{processState} ne "running" ); + next if ( !$Privileged && !CheckPermission($host) ); $Jobs{$host}{type} = $Status{$host}{type} if ( $Jobs{$host}{type} eq "" && defined($Status{$host})); (my $cmd = $Jobs{$host}{cmd}) =~ s/$BinDir\///g; (my $xferPid = $Jobs{$host}{xferPid}) =~ s/,/, /g; $jobStr .= < ${HostLink($host)} - $Jobs{$host}{type} - ${UserLink(defined($Hosts->{$host}) + ${HostLink($host)} + $Jobs{$host}{type} + ${UserLink(defined($Hosts->{$host}) ? $Hosts->{$host}{user} : "")} - $startTime - $cmd - $Jobs{$host}{pid} - $xferPid + $startTime + $cmd + $Jobs{$host}{pid} + $xferPid EOF $jobStr .= "\n"; } @@ -70,6 +71,7 @@ EOF && $Status{$host}{reason} ne "Reason_restore_failed" && (!$Status{$host}{userReq} || $Status{$host}{reason} ne "Reason_no_ping") ); + next if ( !$Privileged && !CheckPermission($host) ); my $startTime = timeStamp2($Status{$host}{startTime}); my($errorTime, $XferViewStr); if ( $Status{$host}{errorTime} > 0 ) { @@ -89,14 +91,14 @@ EOF } (my $shortErr = $Status{$host}{error}) =~ s/(.{48}).*/$1.../; $statusStr .= < ${HostLink($host)} - $Status{$host}{type} - ${UserLink(defined($Hosts->{$host}) + ${HostLink($host)} + $Status{$host}{type} + ${UserLink(defined($Hosts->{$host}) ? $Hosts->{$host}{user} : "")} - $startTime - $XferViewStr - $errorTime - ${EscHTML($shortErr)} + $startTime + $XferViewStr + $errorTime + ${EscHTML($shortErr)} EOF } my $now = timeStamp2(time); @@ -107,6 +109,7 @@ EOF my $numUserQueue = $QueueLen{UserQueue}; my $numCmdQueue = $QueueLen{CmdQueue}; my $serverStartTime = timeStamp2($Info{startTime}); + my $configLoadTime = timeStamp2($Info{ConfigLTime}); my $poolInfo = genPoolInfo("pool", \%Info); my $cpoolInfo = genPoolInfo("cpool", \%Info); if ( $Info{poolFileCnt} > 0 && $Info{cpoolFileCnt} > 0 ) { @@ -123,9 +126,10 @@ EOF } elsif ( $Info{cpoolFileCnt} > 0 ) { $poolInfo = $cpoolInfo; } - - Header($Lang->{H_BackupPC_Server_Status}); - print (eval ("qq{$Lang->{BackupPC_Server_Status}}")); + my $generalInfo = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}") + if ( $Privileged ); + my $content = eval("qq{$Lang->{BackupPC_Server_Status}}"); + Header($Lang->{H_BackupPC_Server_Status}, $content); Trailer(); }