$comment = "(Extracting only Errors)";
} elsif ( $host ne "" && $type eq "config" ) {
$file = "$TopDir/pc/$host/config.pl";
+ $file = "$TopDir/conf/$host.pl"
+ if ( $host ne "config" && -f "$TopDir/conf/$host.pl"
+ && !-f $file );
} elsif ( $type eq "docs" ) {
$file = "$BinDir/../doc/BackupPC.html";
if ( open(LOG, $file) ) {
while ( 1 ) {
$_ = $fh->readLine();
if ( $_ eq "" ) {
- print(eval ("qq{$Lang->{skipped__skipped_lines}}"));
+ print(eval ("qq{$Lang->{skipped__skipped_lines}}"))
+ if ( $skipped );
last;
}
if ( /smb: \\>/
$skipped++;
next;
}
- print(eval("qq{$Lang->{skipped__skipped_lines}}")) if ( $skipped );
+ print(eval("qq{$Lang->{skipped__skipped_lines}}"))
+ if ( $skipped );
$skipped = 0;
print ${EscapeHTML($_)};
}
my($dirOpen, $gotDir, $imgStr, $img);
my $fURI = $f; # URI escaped $f
my $shareURI = $share; # URI escaped $share
- my $path = "$relDir/$f";
+ (my $path = "$relDir/$f") =~ s{//+}{/}g;
if ( $shareURI eq "" ) {
$shareURI = $path;
- $path = "";
+ $path = "/";
}
$path =~ s{^/+}{/};
$path =~ s/([^\w.\/-])/uc sprintf("%%%02x", ord($1))/eg;
# Prune the last directory off $relDir, or at the very end
# do the top-level directory.
#
- if ( $relDir eq "" ) {
+ if ( $relDir eq "" || $relDir eq "/" ) {
$currDir = $share;
$share = "";
+ $relDir = "";
} else {
$relDir =~ s/(.*)\/(.*)/$1/;
$currDir = $2;
}
my @otherDirs;
foreach my $i ( $view->backupList($share, $dir) ) {
- next if ( $i == $num );
my $path = $dir;
my $shareURI = $share;
$path =~ s/([^\w.\/-])/uc sprintf("%%%02x", ord($1))/eg;
$shareURI =~ s/([^\w.\/-])/uc sprintf("%%%02x", ord($1))/eg;
- push(@otherDirs, <<EOF);
-<a href="$MyURL?action=browse&host=$host&num=$i&share=$shareURI&dir=$path">$i</a>
-EOF
+ push(@otherDirs, "<a href=\"$MyURL?action=browse&host=$host&num=$i"
+ . "&share=$shareURI&dir=$path\">$i</a>");
+
}
if ( @otherDirs ) {
- my $otherDirs = join(", ", @otherDirs);
+ my $otherDirs = join(",\n", @otherDirs);
$filledBackup .= eval("qq{$Lang->{Visit_this_directory_in_backup}}");
}
Trailer();
} elsif ( $In{type} == 4 ) {
if ( !defined($Hosts->{$In{hostDest}}) ) {
- ErrorExit(eval("qq{$Lang->{Host_doesn_t_exist}}"));
+ ErrorExit(eval("qq{$Lang->{Host__doesn_t_exist}}"));
}
if ( !CheckPermission($In{hostDest}) ) {
ErrorExit(eval("qq{$Lang->{You_don_t_have_permission_to_restore_onto_host}}"));
<td align="right"> $MBNew </td>
</tr>
EOF
- $Backups[$i]{compress} ||= "off";
- my $is_compress = $Lang->{off};
- if ($Backups[$i]{compress} ne "off") {$is_compress = $Lang->{on}; }
+ my $is_compress = $Backups[$i]{compress} || $Lang->{off};
if (! $ExistComp) { $ExistComp = " "; }
if (! $MBExistComp) { $MBExistComp = " "; }
$compStr .= <<EOF;
if ( defined($bpc) );
if ( !defined($Lang->{Error}) ) {
Header("BackupPC: Error");
+ $mesg = <<EOF if ( !defined($mesg) );
+There is some problem with the BackupPC installation.
+Please check the permissions on BackupPC_Admin.
+EOF
print <<EOF;
-${h1("Error: Language strings not defined!!")}
+${h1("Error: Unable to read config.pl or language strings!!")}
<p>$mesg</p>
EOF
Trailer();
my $poolTime = timeStamp2($info->{"${name}Time"});
$info->{"${name}FileCntRm"} = $info->{"${name}FileCntRm"} + 0;
return eval("qq{$Lang->{Pool_Stat}}");
-
}
###########################################################################
{ link => "?action=queue", name => $Lang->{Current_queues} },
{ link => "?action=view&type=docs", name => $Lang->{Documentation},
priv => 1},
+ { link => "http://backuppc.sourceforge.net/faq", name => "FAQ",
+ priv => 1},
{ link => "http://backuppc.sourceforge.net", name => "SourceForge",
- priv => 1},
+ priv => 1},
);
print $Cgi->header();
print <<EOF;