On Thu, 2011-03-10 at 10:04 +0000, Tyler J. Wagner wrote:
> On Thu, 2011-03-10 at 09:16 +0000, Wayne Trevena wrote:
> > Now, on the main home page for a host, I get a message line saying, Last 
> > email sent to <username> was at 3/10 09:09, subject "".
> 
> I see that for hosts for whom an email address (user) has been set, but
> no email has ever been sent. The date is always the last wakeup period.
> 
> A bit of error handling there would not go amiss. Hmmm...

Attached is a patch for lib/BackupPC/CGI/HostInfo.pm which corrects
this. If no email has ever been sent (last email subject is undefined),
it simply doesn't output the "Last email sent" line.

I can't find a BackupPC bug tracking system online, except via Debian or
Ubuntu. I'll submit this to the backuppc-devel list. Does anyone know
how bug reports are ordinarily filed?

Regards,
Tyler

-- 
"Never underestimate the bandwidth of a station wagon full of tapes
hurtling down the highway.
   -- Andrew S. Tanenbaum
--- HostInfo.pm_orig	2010-10-07 15:37:37.000000000 +0000
+++ HostInfo.pm	2011-03-10 10:09:24.000000000 +0000
@@ -248,12 +248,12 @@
         if ( $user ne "" ) {
             $statusStr .= eval("qq{$Lang->{This_PC_is_used_by}$moreUserStr}");
         }
-        if ( defined($UserEmailInfo{$user}) && defined($UserEmailInfo{$user}{$host}) ) {
+        if ( defined($UserEmailInfo{$user}) && defined($UserEmailInfo{$user}{$host}) && defined($UserEmailInfo{$user}{$host}{lastSubj}) ) {
             my $mailTime = timeStamp2($UserEmailInfo{$user}{$host}{lastTime});
             my $subj     = $UserEmailInfo{$user}{$host}{lastSubj};
             $statusStr  .= eval("qq{$Lang->{Last_email_sent_to__was_at___subject}}");
         } elsif ( defined($UserEmailInfo{$user})
-                && $UserEmailInfo{$user}{lastHost} eq $host ) {
+                && $UserEmailInfo{$user}{lastHost} eq $host && defined($UserEmailInfo{$user}{lastSubj}) ) {
             #
             # Old format %UserEmailInfo - pre 3.2.0.
             #
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to