# Craig Barratt <cbarratt@users.sourceforge.net>
#
# 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
#
#========================================================================
#
-# Version 2.1.0, released 20 Jun 2004.
+# Version 3.2.0, released 31 Jul 2010.
#
# See http://backuppc.sourceforge.net.
#
use strict;
use BackupPC::CGI::Lib qw(:all);
use Data::Dumper;
+use BackupPC::Search;
sub action
{
my($fullDur, $incrCnt, $fullSize, $fullRate);
my @Backups = $bpc->BackupInfoRead($host);
my $fullCnt = $incrCnt = 0;
+
for ( my $i = 0 ; $i < @Backups ; $i++ ) {
if ( $Backups[$i]{type} eq "full" ) {
$fullSize = $Backups[$i]{size} / (1024 * 1024);
}
$fullSizeTot += $fullSize + $incrSizeTot;
$fullSize = sprintf("%.2f", ($fullSize + $incrSizeTot) / 1000);
+
+ $bpc->ConfigRead($archHost);
+ %Conf = $bpc->Conf();
+
+ my $checkboxes;
+ foreach my $backupnumber ( BackupPC::Search::host_backup_nums($host) ) {
+ $checkboxes .= qq|
+<input type="hidden" name="fcb$checkBoxCnt" value="$host">
+<input type="checkbox" name="backup$checkBoxCnt" value="$backupnumber">$backupnumber
+ |;
+ $checkBoxCnt++;
+ }
+
+=for ASA extension removed this
$str = <<EOF;
<tr>
<td class="border"><input type="hidden" name="backup$checkBoxCnt" value="$backupnumber"><input type="checkbox" name="fcb$checkBoxCnt" value="$host"> ${HostLink($host)} </td>
<td align="center" class="border"> $fullSize </td>
EOF
$checkBoxCnt++;
+=cut
+
+ $str = <<EOF;
+<tr>
+<td class="border">
+${HostLink($host)}
+$checkboxes
+</td>
+<td align="center" class="border">
+${UserLink($Hosts->{$host}{user})}
+</td>
+<td align="center" class="border"> $fullSize </td>
+EOF
+
if ( @Backups == 0 ) {
$hostCntNone++;
$strNone .= $str;
next if ( !defined($In{"fcb$i"}) );
my $name = $In{"fcb$i"};
my $backupno = $In{"backup$i"};
+ next unless defined $backupno; # ASA - skip hosts without backups checked
push(@HostList, $name);
push(@BackupList, $backupno);
$hiddenStr .= <<EOF;
<input type="hidden" name="backup$i" value="$In{'backup' . $i}">
EOF
$HostListStr .= <<EOF;
-<li> ${EscHTML($name)}
+<li> ${EscHTML($name)} $i
EOF
}
$hiddenStr .= <<EOF;
$compname = $Conf{CatPath};
$compext = '.raw';
}
- my $fullsplitsize = $In{splitsize} . '000000';
+ my $fullsplitsize = $In{splitsize} . '000000'; # mb -> bytes
my %ArchiveReq = (
# parameters for the archive
archiveloc => $In{archive_device},
[ \%ArchiveReq],
[qw(*ArchiveReq)]);
$archive->Indent(1);
- if ( open(REQ, ">$TopDir/pc/$archivehost/$reqFileName") ) {
+ my $openPath = "$TopDir/pc/$archivehost/$reqFileName";
+ if ( open(REQ, ">", $openPath) ) {
binmode(REQ);
print(REQ $archive->Dump);
close(REQ);
} else {
- ErrorExit($Lang->{Can_t_open_create} );
+ ErrorExit(eval("qq{$Lang->{Can_t_open_create__openPath}}"));
}
$reply = $bpc->ServerMesg("archive $User $archivehost $reqFileName");
$str = eval("qq{$Lang->{Archive_requested}}");