]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/updatexlrator.cgi
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / updatexlrator.cgi
index 147be8e5eb1fdfe89447d0b2fccd50344b91bc43..09f9f5de1d1913173576c393e38d99f47b4a6b66 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
 #                                                                             #
 ###############################################################################
+#
+# Changelog:
+# 2012-10-27: nightshift - Bugfix regarding showing wrong vendor icon while Download of new Updates
+# 2012-10-27: nightshift - Optimizing logic of check for vendor icons
+#
 
 use strict;
 
@@ -75,6 +80,7 @@ my @vendors=();
 my %vendorstats=();
 
 my $repository = "/var/updatecache/";
+my $webhome = "/srv/web/ipfire/html";
 my $hintcolour = '#FFFFCC';
 my $colourgray = '#808080';
 
@@ -94,14 +100,10 @@ my @downloadfiles=();
 
 my @metadata=();
 
-my $chk_cron_dly = "${General::swroot}/updatexlrator/autocheck/cron.daily";
-my $chk_cron_wly = "${General::swroot}/updatexlrator/autocheck/cron.weekly";
-my $chk_cron_mly = "${General::swroot}/updatexlrator/autocheck/cron.monthly";
-
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 &General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 
 $xlratorsettings{'ACTION'} = '';
 $xlratorsettings{'ENABLE_LOG'} = 'off';
@@ -190,33 +192,33 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr purge'})
 
                        if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource))
                        {
-                               if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                               if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                        }
                        if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated))
                        {
-                               if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                               if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                        }
                        if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on')
                        {
                                if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800)))
                                {
-                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                                }
                                if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600)))
                                {
-                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                                }
                                if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800)))
                                {
-                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                                }
                                if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600)))
                                {
-                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                                }
                                if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000)))
                                {
-                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+                                       if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
                                }
                        }
                }
@@ -264,7 +266,7 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'})
 
        &savesettings;
 
-       system('/usr/local/bin/squidctrl restart >/dev/null 2>&1');
+       &General::system('/usr/local/bin/squidctrl', 'restart');
 }
 
 if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'})
@@ -276,7 +278,7 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'})
        unless ($updatefile =~ /^download\//)
        {
                ($vendorid,$uuid,$updatefile) = split('/',$updatefile);
-               if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+               if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
        }
 }
 
@@ -293,16 +295,16 @@ if (($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr cancel download'}) || ($x
                        &General::readhash("$repository/download/$vendorid/$updatefile.info", \%dlinfo);
 
                        $id = &getPID("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$");
-                       if ($id) { system("/bin/kill -9 $id"); }
+                       if ($id) { &General::system("/bin/kill", "-9", "$id"); }
                        $id = &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$");
-                       if ($id) { system("/bin/kill -9 $id"); }
+                       if ($id) { &General::system("/bin/kill", "-9", "$id"); }
 
-                       system("rm $repository/download/$vendorid/$updatefile.info");
+                       &General::system("rm", "$repository/download/$vendorid/$updatefile.info");
                }
 
                if (-e "$repository/download/$vendorid/$updatefile")
                {
-                       system("rm $repository/download/$vendorid/$updatefile");
+                       &General::system("rm", "$repository/download/$vendorid/$updatefile");
                }
        }
 
@@ -367,7 +369,7 @@ $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selecte
 
 &Header::showhttpheaders();
 
-&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, '');
+&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, $Header::extraHead);
 
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
@@ -395,8 +397,8 @@ print <<END
 <tr>
        <td class='base'>$Lang::tr{'updxlrtr passive mode'}:</td>
        <td class='base'><input type='checkbox' name='PASSIVE_MODE' $checked{'PASSIVE_MODE'}{'on'} /></td>
-       <td class='base'>$Lang::tr{'updxlrtr max disk usage'}:</td>
-       <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='1' /> %</td>
+       <td class='base'>$Lang::tr{'updxlrtr max disk usage'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
+       <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='3' /> %</td>
 </tr>
 </table>
 <hr size='1'>
@@ -407,7 +409,7 @@ print <<END
 <tr>
        <td class='base' width='25%'>$Lang::tr{'updxlrtr low download priority'}:</td>
        <td class='base' width='20%'><input type='checkbox' name='LOW_DOWNLOAD_PRIORITY' $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} /></td>
-       <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}:&nbsp;<img src='/blob.gif' alt='*' </td>
+       <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}:</td>
        <td class='base' width='30%'><input type='text' name='MAX_DOWNLOAD_RATE' value='$xlratorsettings{'MAX_DOWNLOAD_RATE'}' size='5' /></td>
 </tr>
 </table>
@@ -515,7 +517,7 @@ END
                $id = 0;
                foreach $updatefile (@downloadfiles)
                {
-                       $updatefile =~ s/.*://;
+                       $updatefile =~ s/.*:download/download/;
                        my $size_updatefile = 0;
                        my $mtime = 0;
                        if(-e "$repository/$updatefile") {
@@ -530,9 +532,9 @@ END
 
                        $id++;
                        if ($id % 2) {
-                               print "<tr bgcolor='$Header::table1colour'>\n"; }
+                               print "<tr class='table1colour'>\n"; }
                        else {
-                               print "<tr bgcolor='$Header::table2colour'>\n"; }
+                               print "<tr class='table2colour'>\n"; }
 
                        $filesize = $size_updatefile;
                        1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
@@ -553,46 +555,23 @@ END
                        print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' />&nbsp;</td>\n";
                }
 
-                       print "\t\t<td align='center' nowrap='nowrap'>&nbsp;";
-                       if ($vendorid =~ /^Adobe$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^Microsoft$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^Symantec$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^Linux$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^TrendMicro$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^Apple$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' />&nbsp;</td>\n";
-                       } elsif ($vendorid =~ /^Avast$/i)
-                       {
-                               print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' />&nbsp;</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 . "' />&nbsp;</td>\n";
-                               } else {
-                                       print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' />&nbsp;</td>\n";
-                               }
-                       }
+               print "\t\t<td align='center' nowrap='nowrap'>&nbsp;";
 
-                       $shortname = substr($updatefile,rindex($updatefile,"/")+1);
-                       $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
+               if (($vendorid ne '') && (-e "$webhome/images/updbooster/updxl-src-$vendorid.gif"))
+               {
+                       print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' />&nbsp;</td>\n";
+               } else {
+                       print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' />&nbsp;</td>\n";
+               }
 
-                       $filesize = $dlinfo{'REMOTESIZE'};
-                       1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
-                       $dlinfo{'VENDORID'}=ucfirst $vendorid;
+               $shortname = substr($updatefile,rindex($updatefile,"/")+1);
+               $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
 
-                       print <<END
+               $filesize = $dlinfo{'REMOTESIZE'};
+               1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
+               $dlinfo{'VENDORID'} = ucfirst $vendorid;
+
+               print <<END
                <td class='base' align='center'>&nbsp;$dlinfo{'VENDORID'}&nbsp;</td>
                <td class='base' align='left' title='cache:/$updatefile'>$shortname</td>
                <td class='base' align='right'  nowrap='nowrap'>&nbsp;$filesize&nbsp;</td>
@@ -743,15 +722,18 @@ unless ($numfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr s
 
 print <<END
 <table>
-<tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
+<tr>
+<td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
+</tr>
 </table>
-<table cellpadding='3'>
+<table width='75%' cellspacing='5'>
 <tr>
-<td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
-<td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
+<td></td>
+<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
 </tr>
 END
 ;
@@ -766,17 +748,17 @@ my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
 
 print <<END
 <tr>
-<td>[$repository]</td>
-<td align='right'>$size</td>
-<td align='right'>$used</td>
-<td align='right'>$free</td>
-<td>
+<td align='center'>[$repository]</td>
+<td align='center'>$size</td>
+<td align='center'>$used</td>
+<td align='center'>$free</td>
+<td align='right' colspan='2'>
 END
 ;
 &percentbar($percent);
 print <<END
 </td>
-<td align='right'>$percent</td>
+<td align='center'>$percent</td>
 </tr>
 </table>
 END
@@ -841,9 +823,9 @@ foreach (@vendors)
 
        $id++;
        if ($id % 2) {
-               print "<tr bgcolor=''$color{'color20'}'>\n"; }
+               print "<tr class='color20'>\n"; }
        else {
-               print "<tr bgcolor=''$color{'color22'}'>\n"; }
+               print "<tr class='color22'>\n"; }
 
        print "<td class='base' align='center'><nobr>&nbsp;";
 
@@ -992,7 +974,8 @@ foreach (@sources)
                {
                        next if(/\.info$/);
                        $updatefile = substr($_,rindex($_,"/")+1);
-                       $updatefile .= ":download/$vendorid/$updatefile";
+                       $_ = $updatefile; tr/[A-Z]/[a-z]/;
+                       $updatefile = "$_:separator:download/$vendorid/$updatefile";
                        $updatefile = " ".$updatefile;
                        push(@repositoryfiles,$updatefile);
                }
@@ -1023,7 +1006,7 @@ foreach (@sources)
                        chomp($sourceurl);
                        $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
                        $_ = $updatefile; tr/[A-Z]/[a-z]/;
-                       $updatefile = "$_:$vendorid/$uuid/$updatefile";
+                       $updatefile = "$_:separator:$vendorid/$uuid/$updatefile";
                        push(@repositoryfiles,$updatefile);
                }
        }
@@ -1035,15 +1018,18 @@ unless (@repositoryfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>
 
 print <<END
 <table>
-<tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
+<tr>
+<td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
+</tr>
 </table>
-<table cellpadding='3'>
+<table width='75%' cellspacing='5'>
 <tr>
-<td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
-<td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
+<td></td>
+<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
 </tr>
 END
 ;
@@ -1058,17 +1044,17 @@ my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
 
 print <<END
 <tr>
-<td>[$repository]</td>
-<td align='right'>$size</td>
-<td align='right'>$used</td>
-<td align='right'>$free</td>
-<td>
+<td align='center'>[$repository]</td>
+<td align='center'>$size</td>
+<td align='center'>$used</td>
+<td align='center'>$free</td>
+<td align='right' colspan='2'>
 END
 ;
 &percentbar($percent);
 print <<END
 </td>
-<td align='right'>$percent</td>
+<td align='center'>$percent</td>
 </tr>
 </table>
 END
@@ -1166,7 +1152,7 @@ END
        $id = 0;
        foreach $updatefile (@files)
        {
-               $updatefile =~ s/.*://;
+               $updatefile =~ s/.*:separator://;
                my $size_updatefile = 0;
                my $mtime = 0;
                if(-e "$repository/$updatefile") {
@@ -1176,9 +1162,9 @@ END
 
                $id++;
                if ($id % 2) {
-                       print "<tr bgcolor='$Header::table1colour'>\n"; }
+                       print "<tr class='table1colour'>\n"; }
                else {
-                       print "<tr bgcolor='$Header::table2colour'>\n"; }
+                       print "<tr class='table2colour'>\n"; }
 
                $filesize = $size_updatefile;
                1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
@@ -1366,7 +1352,7 @@ sub printlegendicons
                <td><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
                <td class='base'>$Lang::tr{'updxlrtr last checkup'}</td>
                <td class='base'>&nbsp;</td>
-               <td><img src='/images/updbooster/delete.gif' alt='$Lang::tr{'updxlrtr remove file'}' /></td>
+               <td><img src='/images/delete.gif' alt='$Lang::tr{'updxlrtr remove file'}' /></td>
                <td class='base'>$Lang::tr{'updxlrtr remove file'}</td>
                <td class='base'>&nbsp;</td>
                <td class='base'>&nbsp;</td>
@@ -1495,27 +1481,18 @@ END
 
 sub savesettings
 {
-       if (-e $chk_cron_dly) { unlink($chk_cron_dly); }
-       if (-e $chk_cron_wly) { unlink($chk_cron_wly); }
-       if (-e $chk_cron_mly) { unlink($chk_cron_mly); }
 
        if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily'))
        {
-               symlink("../bin/checkup",$chk_cron_dly)
-       } else {
-               symlink("/bin/false",$chk_cron_dly)
+               &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'daily');
        }
-               if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
+       if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
        {
-               symlink("../bin/checkup",$chk_cron_wly)
-       } else {
-               symlink("/bin/false",$chk_cron_wly)
+               &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'weekly');
        }
-               if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
+       if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
        {
-               symlink("../bin/checkup",$chk_cron_mly)
-       } else {
-               symlink("/bin/false",$chk_cron_mly)
+               &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'monthly');
        }
 
        # don't save those variable to the settings file,
@@ -1545,22 +1522,20 @@ sub savesettings
 sub percentbar
 {
   my $percent = $_[0];
-  my $fg = '#a0a0a0';
-  my $bg = '#e2e2e2';
 
   if ($percent =~ m/^(\d+)%$/ )
   {
     print <<END
-<table width='100' border='1' cellspacing='0' cellpadding='0' style='border-width:1px;border-style:solid;border-color:$fg;width:100px;height:10px;'>
+<table width='100' border='1' cellspacing='0' cellpadding='0' class='percent-box'>
 <tr>
 END
 ;
     if ($percent eq "100%") {
-      print "<td width='100%' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'>"
+      print "<td width='100%' class='percent-bar'>"
     } elsif ($percent eq "0%") {
-      print "<td width='100%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
+      print "<td width='100%' class='percent-space'>"
     } else {
-      print "<td width='$percent' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'></td><td width='" . (100-$1) . "%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
+      print "<td width='$percent' class='percent-bar'></td><td width='" . (100-$1) . "%' class='percent-space'>"
     }
     print <<END
 <img src='/images/null.gif' width='1' height='1' alt='' /></td></tr></table>