+# ----------------------------------------------------
+# List pending downloads - if any
+# ----------------------------------------------------
+
+if (($xlratorsettings{'EXTENDED_GUI'} ne 'statistics') && ($xlratorsettings{'EXTENDED_GUI'} ne 'maintenance'))
+{
+ @downloadlist = <$repository/download/*>;
+
+ undef(@downloadfiles);
+ foreach (@downloadlist)
+ {
+ if (-d)
+ {
+ my @filelist = <$_/*>;
+ $vendorid = substr($_,rindex($_,"/")+1);
+ foreach(@filelist)
+ {
+ next if(/\.info$/);
+ $updatefile = substr($_,rindex($_,"/")+1);
+ $updatefile .= ":download/$vendorid/$updatefile";
+ $updatefile = " ".$updatefile;
+ push(@downloadfiles, $updatefile);
+ }
+ }
+ }
+
+ if (@downloadfiles)
+ {
+ &Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr pending downloads'}");
+
+ print <<END
+<table>
+ <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current downloads'}</b></td></tr>
+</table>
+<table width='100%'>
+<colgroup span='3' width='2%'></colgroup>
+<colgroup span='1' width='0*'></colgroup>
+<colgroup span='3' width='5%'></colgroup>
+<colgroup span='1' width='2%'></colgroup>
+<tr>
+ <td class='base' align='center'> </td>
+ <td class='base' align='left' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
+ <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
+ <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
+ <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
+ <td class='base' align='center'><i>$Lang::tr{'updxlrtr progress'}</i></td>
+ <td class='base' align='center'> </td>
+</tr>
+END
+;
+ $id = 0;
+ foreach $updatefile (@downloadfiles)
+ {
+ $updatefile =~ s/.*://;
+ my $size_updatefile = 0;
+ my $mtime = 0;
+ if(-e "$repository/$updatefile") {
+ $size_updatefile = (-s "$repository/$updatefile");
+ $mtime = &getmtime("$repository/$updatefile");
+ }
+ if (-e "$repository/$updatefile.info") {
+ &General::readhash("$repository/$updatefile.info", \%dlinfo);
+ } else {
+ undef(%dlinfo);
+ }
+
+ $id++;
+ if ($id % 2) {
+ print "<tr bgcolor='$Header::table1colour'>\n"; }
+ else {
+ print "<tr bgcolor='$Header::table2colour'>\n"; }
+
+ $filesize = $size_updatefile;
+ 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
+
+ my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
+ $DAYdt = sprintf ("%.02d",$DAYdt);
+ $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
+ $YEARdt = sprintf ("%.04d",$YEARdt+1900);
+ $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
+
+ ($uuid,$vendorid,$shortname) = split('/',$updatefile);
+
+ print "\t\t<td align='center' nowrap='nowrap'> ";
+ if (&getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"))
+ {
+ print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
+ } else {
+ print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /> </td>\n";
+ }
+
+ print "\t\t<td align='center' nowrap='nowrap'> ";
+ if ($vendorid =~ /^Adobe$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
+ } elsif ($vendorid =~ /^Microsoft$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
+ } elsif ($vendorid =~ /^Symantec$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
+ } elsif ($vendorid =~ /^Linux$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
+ } elsif ($vendorid =~ /^TrendMicro$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
+ } elsif ($vendorid =~ /^Apple$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
+ } elsif ($vendorid =~ /^Avast$/i)
+ {
+ print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
+ } else
+ {
+ if (-e "/home/httpd/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
+ {
+ print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
+ } else {
+ print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
+ }
+ }
+
+ $shortname = substr($updatefile,rindex($updatefile,"/")+1);
+ $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
+
+ $filesize = $dlinfo{'REMOTESIZE'};
+ 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
+ $dlinfo{'VENDORID'}=ucfirst $vendorid;
+
+ print <<END
+ <td class='base' align='center'> $dlinfo{'VENDORID'} </td>
+ <td class='base' align='left' title='cache:/$updatefile'>$shortname</td>
+ <td class='base' align='right' nowrap='nowrap'> $filesize </td>
+ <td class='base' align='center' nowrap='nowrap'> $filedate </td>
+ <td class='base' align='center' nowrap='nowrap'>
+END
+;
+ my $percent="0%";
+ if ($dlinfo{'REMOTESIZE'} && $size_updatefile)
+ {
+ $percent=int(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile))."%";
+ }
+ print $percent; &percentbar($percent);
+ print <<END
+ </td>
+ <td align='center'>
+ <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='image' name='$Lang::tr{'updxlrtr cancel download'}' src='/images/delete.gif' title='$Lang::tr{'updxlrtr cancel download'}' alt='$Lang::tr{'updxlrtr cancel download'}' />
+ <input type='hidden' name='ID' value='$updatefile' />
+ <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr cancel download'}' />
+ </form>
+ </td>
+ </tr>
+END
+;
+ }
+
+ print "</table>\n<br>\n<table>\n";
+ &printlegenddownload();
+ print "</table>\n";
+
+ &Header::closebox();
+ }
+}