EmailSummary.pm (BackupPC-4.3.2) | : | EmailSummary.pm (BackupPC-4.4.0) | ||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
# This program is distributed in the hope that it will be useful, | # This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | # GNU General Public License for more details. | |||
# | # | |||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | |||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
# | # | |||
# Version 4.3.2, released 17 Feb 2020. | # Version 4.4.0, released 20 Jun 2020. | |||
# | # | |||
# See http://backuppc.sourceforge.net. | # See http://backuppc.sourceforge.net. | |||
# | # | |||
#======================================================================== | #======================================================================== | |||
package BackupPC::CGI::EmailSummary; | package BackupPC::CGI::EmailSummary; | |||
use strict; | use strict; | |||
use BackupPC::CGI::Lib qw(:all); | use BackupPC::CGI::Lib qw(:all); | |||
skipping to change at line 53 | skipping to change at line 53 | |||
my $Privileged = CheckPermission(); | my $Privileged = CheckPermission(); | |||
if ( !$Privileged ) { | if ( !$Privileged ) { | |||
ErrorExit($Lang->{Only_privileged_users_can_view_email_summaries}); | ErrorExit($Lang->{Only_privileged_users_can_view_email_summaries}); | |||
} | } | |||
GetStatusInfo("hosts"); | GetStatusInfo("hosts"); | |||
ReadUserEmailInfo(); | ReadUserEmailInfo(); | |||
my(%EmailStr, $str); | my(%EmailStr, $str); | |||
foreach my $u ( keys(%UserEmailInfo) ) { | foreach my $u ( keys(%UserEmailInfo) ) { | |||
my $info; | my $info; | |||
if ( defined($UserEmailInfo{$u}{lastTime}) | if ( defined($UserEmailInfo{$u}{lastTime}) && ref($UserEmailInfo{$u}{las | |||
&& ref($UserEmailInfo{$u}{lastTime}) ne 'HASH' ) { | tTime}) ne 'HASH' ) { | |||
# | # | |||
# old format $UserEmailInfo - pre 3.2.0. | # old format $UserEmailInfo - pre 3.2.0. | |||
# | # | |||
my $host = $UserEmailInfo{$u}{lastHost}; | my $host = $UserEmailInfo{$u}{lastHost}; | |||
$info = { | $info = { | |||
$host => { | $host => { | |||
lastTime => $UserEmailInfo{$u}{lastTime}, | lastTime => $UserEmailInfo{$u}{lastTime}, | |||
lastSubj => $UserEmailInfo{$u}{lastSubj}, | lastSubj => $UserEmailInfo{$u}{lastSubj}, | |||
}, | }, | |||
}; | }; | |||
skipping to change at line 79 | skipping to change at line 78 | |||
next if ( !defined($info->{$host}{lastTime}) ); | next if ( !defined($info->{$host}{lastTime}) ); | |||
my $emailTimeStr = timeStamp2($info->{$host}{lastTime}); | my $emailTimeStr = timeStamp2($info->{$host}{lastTime}); | |||
$EmailStr{$info->{$host}{lastTime}} .= <<EOF; | $EmailStr{$info->{$host}{lastTime}} .= <<EOF; | |||
<tr><td>${UserLink($u)} </td> | <tr><td>${UserLink($u)} </td> | |||
<td>${HostLink($host)} </td> | <td>${HostLink($host)} </td> | |||
<td data-date_format="$Conf{CgiDateFormatMMDD}">$emailTimeStr </td> | <td data-date_format="$Conf{CgiDateFormatMMDD}">$emailTimeStr </td> | |||
<td>$info->{$host}{lastSubj} </td></tr> | <td>$info->{$host}{lastSubj} </td></tr> | |||
EOF | EOF | |||
} | } | |||
} | } | |||
foreach my $t ( sort({$b <=> $a} keys(%EmailStr)) ) { | foreach my $t ( sort({ $b <=> $a } keys(%EmailStr)) ) { | |||
$str .= $EmailStr{$t}; | $str .= $EmailStr{$t}; | |||
} | } | |||
my $content = eval("qq{$Lang->{Recent_Email_Summary}}"); | my $content = eval("qq{$Lang->{Recent_Email_Summary}}"); | |||
Header($Lang->{Email_Summary}, $content); | Header($Lang->{Email_Summary}, $content); | |||
Trailer(); | Trailer(); | |||
} | } | |||
1; | 1; | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |