ArchiveInfo.pm (BackupPC-4.3.2) | : | ArchiveInfo.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::ArchiveInfo; | package BackupPC::CGI::ArchiveInfo; | |||
use strict; | use strict; | |||
use BackupPC::CGI::Lib qw(:all); | use BackupPC::CGI::Lib qw(:all); | |||
sub action | sub action | |||
{ | { | |||
my $Privileged = CheckPermission($In{host}); | my $Privileged = CheckPermission($In{host}); | |||
my $host = $1 if ( $In{host} =~ /(.*)/ ); | my $host = $1 if ( $In{host} =~ /(.*)/ ); | |||
my $num = $In{num}; | my $num = $In{num}; | |||
my $i; | my $i; | |||
if ( !$Privileged ) { | if ( !$Privileged ) { | |||
ErrorExit($Lang->{Only_privileged_users_can_view_archive_information}); | ErrorExit($Lang->{Only_privileged_users_can_view_archive_information}); | |||
} | } | |||
# | # | |||
# Find the requested archive | # Find the requested archive | |||
# | # | |||
my @Archives = $bpc->ArchiveInfoRead($host); | my @Archives = $bpc->ArchiveInfoRead($host); | |||
for ( $i = 0 ; $i < @Archives ; $i++ ) { | for ( $i = 0 ; $i < @Archives ; $i++ ) { | |||
last if ( $Archives[$i]{num} == $num ); | last if ( $Archives[$i]{num} == $num ); | |||
} | } | |||
if ( $i >= @Archives ) { | if ( $i >= @Archives ) { | |||
ErrorExit(eval("qq{$Lang->{Archive_number__num_for_host__does_not_exist} }")); | ErrorExit(eval("qq{$Lang->{Archive_number__num_for_host__does_not_exist} }")); | |||
} | } | |||
%ArchiveReq = (); | %ArchiveReq = (); | |||
do "$TopDir/pc/$host/ArchiveInfo.$Archives[$i]{num}" | do "$TopDir/pc/$host/ArchiveInfo.$Archives[$i]{num}" | |||
if ( -f "$TopDir/pc/$host/ArchiveInfo.$Archives[$i]{num}" ); | if ( -f "$TopDir/pc/$host/ArchiveInfo.$Archives[$i]{num}" ); | |||
my $startTime = timeStamp2($Archives[$i]{startTime}); | my $startTime = timeStamp2($Archives[$i]{startTime}); | |||
my $reqTime = timeStamp2($ArchiveReq{reqTime}); | my $reqTime = timeStamp2($ArchiveReq{reqTime}); | |||
my $dur = $Archives[$i]{endTime} - $Archives[$i]{startTime}; | my $dur = $Archives[$i]{endTime} - $Archives[$i]{startTime}; | |||
$dur = 1 if ( $dur <= 0 ); | $dur = 1 if ( $dur <= 0 ); | |||
my $duration = sprintf("%.1f", $dur / 60); | my $duration = sprintf("%.1f", $dur / 60); | |||
my $HostListStr = ""; | my $HostListStr = ""; | |||
my $counter=0; | my $counter = 0; | |||
foreach my $f ( @{$ArchiveReq{HostList}} ) { | foreach my $f ( @{$ArchiveReq{HostList}} ) { | |||
$HostListStr .= <<EOF; | $HostListStr .= <<EOF; | |||
<tr><td>$f</td><td>@{$ArchiveReq{BackupList}}[$counter]</td></tr> | <tr><td>$f</td><td>@{$ArchiveReq{BackupList}}[$counter]</td></tr> | |||
EOF | EOF | |||
$counter++; | $counter++; | |||
} | } | |||
my $content = eval("qq{$Lang->{Archive___num_details_for__host2 }}"); | my $content = eval("qq{$Lang->{Archive___num_details_for__host2}}"); | |||
Header(eval("qq{$Lang->{Archive___num_details_for__host}}"), $content, 1); | Header(eval("qq{$Lang->{Archive___num_details_for__host}}"), $content, 1); | |||
Trailer(); | Trailer(); | |||
} | } | |||
1; | 1; | |||
End of changes. 7 change blocks. | ||||
9 lines changed or deleted | 9 lines changed or added |