X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FEmailSummary.pm;h=70736f752f32cd7c7669edfed4c1882be52b7d9f;hp=1b9ec7024fac016fbdfeb0513145f2b34b2a5c79;hb=ca593f66fd6c35764bd8997c6338b781330f019c;hpb=329e870f56fb6572fa697998d33676588034c149;ds=sidebyside diff --git a/lib/BackupPC/CGI/EmailSummary.pm b/lib/BackupPC/CGI/EmailSummary.pm index 1b9ec70..70736f7 100644 --- a/lib/BackupPC/CGI/EmailSummary.pm +++ b/lib/BackupPC/CGI/EmailSummary.pm @@ -10,7 +10,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2003 Craig Barratt +# Copyright (C) 2003-2009 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 3.2.0beta1, released 10 Jan 2010. # # See http://backuppc.sourceforge.net. # @@ -50,20 +50,38 @@ sub action ReadUserEmailInfo(); my(%EmailStr, $str); foreach my $u ( keys(%UserEmailInfo) ) { - next if ( !defined($UserEmailInfo{$u}{lastTime}) ); - my $emailTimeStr = timeStamp2($UserEmailInfo{$u}{lastTime}); - $EmailStr{$UserEmailInfo{$u}{lastTime}} .= < { + lastTime => $UserEmailInfo{$u}{lastTime}, + lastSubj => $UserEmailInfo{$u}{lastSubj}, + }, + }; + } else { + $info = $UserEmailInfo{$u}; + } + foreach my $host ( keys(%$info) ) { + next if ( !defined($info->{$host}{lastTime}) ); + my $emailTimeStr = timeStamp2($info->{$host}{lastTime}); + $EmailStr{$info->{$host}{lastTime}} .= <${UserLink($u)} - ${HostLink($UserEmailInfo{$u}{lastHost})} + ${HostLink($host)} $emailTimeStr - $UserEmailInfo{$u}{lastSubj} + $info->{$host}{lastSubj} EOF + } } foreach my $t ( sort({$b <=> $a} keys(%EmailStr)) ) { $str .= $EmailStr{$t}; } - Header($Lang->{Email_Summary}); - print (eval("qq{$Lang->{Recent_Email_Summary}}")); + my $content = eval("qq{$Lang->{Recent_Email_Summary}}"); + Header($Lang->{Email_Summary}, $content); Trailer(); }