X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FSummary.pm;h=fd2444cee335060cae18e270eea5402b94093bfd;hp=0706b6209b394ea54a401f85ddcaa0f45660c1e3;hb=8f5625f9cdf47f8e04be654c4954838b2df3e26d;hpb=329e870f56fb6572fa697998d33676588034c149 diff --git a/lib/BackupPC/CGI/Summary.pm b/lib/BackupPC/CGI/Summary.pm index 0706b62..fd2444c 100644 --- a/lib/BackupPC/CGI/Summary.pm +++ b/lib/BackupPC/CGI/Summary.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0beta0, released 20 Mar 2004. # # See http://backuppc.sourceforge.net. # @@ -48,15 +48,20 @@ sub action GetStatusInfo("hosts"); my $Privileged = CheckPermission(); - if ( !$Privileged ) { - ErrorExit($Lang->{Only_privileged_users_can_view_PC_summaries} ); - } - foreach my $host ( sort(keys(%Status)) ) { + foreach my $host ( GetUserHosts(1) ) { my($fullDur, $incrCnt, $incrAge, $fullSize, $fullRate, $reasonHilite); my($shortErr); my @Backups = $bpc->BackupInfoRead($host); my $fullCnt = $incrCnt = 0; my $fullAge = $incrAge = -1; + + $bpc->ConfigRead($host); + %Conf = $bpc->Conf(); + + if ( $Conf{XferMethod} eq "archive" ) { + next; + } + for ( my $i = 0 ; $i < @Backups ; $i++ ) { if ( $Backups[$i]{type} eq "full" ) { $fullCnt++; @@ -102,17 +107,17 @@ sub action } $str = < ${HostLink($host)} - ${UserLink(defined($Hosts->{$host}) + ${HostLink($host)} + ${UserLink(defined($Hosts->{$host}) ? $Hosts->{$host}{user} : "")} - $fullCnt - $fullAge - $fullSize - $fullRate - $incrCnt - $incrAge - $Lang->{$Status{$host}{state}} - $Lang->{$Status{$host}{reason}}$shortErr + $fullCnt + $fullAge + $fullSize + $fullRate + $incrCnt + $incrAge + $Lang->{$Status{$host}{state}} + $Lang->{$Status{$host}{reason}}$shortErr EOF if ( @Backups == 0 ) { $hostCntNone++; @@ -126,9 +131,8 @@ EOF $incrSizeTot = sprintf("%.2f", $incrSizeTot / 1000); my $now = timeStamp2(time); - Header($Lang->{BackupPC__Server_Summary}); - print eval ("qq{$Lang->{BackupPC_Summary}}"); - + my $content = eval ("qq{$Lang->{BackupPC_Summary}}"); + Header($Lang->{BackupPC__Server_Summary}, $content); Trailer(); }