From: Michael Tremer Date: Sat, 11 May 2013 09:39:36 +0000 (+0200) Subject: Revert "Update accelerator changes from Jörn-Ingo Weigert." X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=2ad1a8bc0cc74ab98f0255657edcc53e54841680 Revert "Update accelerator changes from Jörn-Ingo Weigert." This reverts commit 5cf2c339680b6922a08ebf1d44dab5c90ba2d5d4. Conflicts: html/html/themes/ipfire/include/functions.pl html/html/themes/maniac/include/functions.pl langs/de/cgi-bin/de.pl langs/en/cgi-bin/en.pl --- diff --git a/config/rootfiles/core/68/filelists/files b/config/rootfiles/core/68/filelists/files index c96e7cfa0..794039d08 100644 --- a/config/rootfiles/core/68/filelists/files +++ b/config/rootfiles/core/68/filelists/files @@ -4,39 +4,9 @@ etc/modprobe.d/blacklist srv/web/ipfire/cgi-bin/connections.cgi srv/web/ipfire/cgi-bin/ovpnmain.cgi srv/web/ipfire/cgi-bin/services.cgi -srv/web/ipfire/cgi-bin/updatexlrator.cgi -srv/web/ipfire/html/images/updbooster/updxl-src-adobe.gif -srv/web/ipfire/html/images/updbooster/updxl-src-ageofconan.gif -srv/web/ipfire/html/images/updbooster/updxl-src-apple.gif -srv/web/ipfire/html/images/updbooster/updxl-src-avast.gif -srv/web/ipfire/html/images/updbooster/updxl-src-avg.gif -srv/web/ipfire/html/images/updbooster/updxl-src-avira.gif -srv/web/ipfire/html/images/updbooster/updxl-src-curse.gif -srv/web/ipfire/html/images/updbooster/updxl-src-diabloiii.gif -srv/web/ipfire/html/images/updbooster/updxl-src-eveonline.gif -srv/web/ipfire/html/images/updbooster/updxl-src-google.gif -srv/web/ipfire/html/images/updbooster/updxl-src-ipfire.gif -srv/web/ipfire/html/images/updbooster/updxl-src-kaspersky.gif -srv/web/ipfire/html/images/updbooster/updxl-src-linux.gif -srv/web/ipfire/html/images/updbooster/updxl-src-microsoft.gif -srv/web/ipfire/html/images/updbooster/updxl-src-mozilla.gif -srv/web/ipfire/html/images/updbooster/updxl-src-nvidia.gif -srv/web/ipfire/html/images/updbooster/updxl-src-opera.gif -srv/web/ipfire/html/images/updbooster/updxl-src-secunia.gif -srv/web/ipfire/html/images/updbooster/updxl-src-swtor.gif -srv/web/ipfire/html/images/updbooster/updxl-src-symantec.gif -srv/web/ipfire/html/images/updbooster/updxl-src-trendmicro.gif -srv/web/ipfire/html/images/updbooster/updxl-src-unknown.gif -srv/web/ipfire/html/images/updbooster/updxl-src-windows.gif -srv/web/ipfire/html/images/updbooster/updxl-src-wot.gif -srv/web/ipfire/html/images/updbooster/updxl-src-wow.gif srv/web/ipfire/html/themes/ipfire/include/style.css -srv/web/ipfire/html/themes/ipfire/include/upxlr.css srv/web/ipfire/html/themes/ipfire/include/functions.pl -srv/web/ipfire/html/themes/ipfire/images/updxl-icons.gif srv/web/ipfire/html/themes/maniac/include/style.css -srv/web/ipfire/html/themes/maniac/include/upxlr.css -srv/web/ipfire/html/themes/maniac/images/updxl-icons.gif srv/web/ipfire/html/include/jquery-1.9.1.min.js usr/bin/locale usr/local/bin/consort.sh diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index 42362c273..df77a86af 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -36,8 +36,8 @@ use strict; # enable only the following on debugging purpose -use warnings; # no warnings 'once';# 'redefine', 'uninitialized'; -use CGI::Carp 'fatalsToBrowser'; +#use warnings; no warnings 'once';# 'redefine', 'uninitialized'; +#use CGI::Carp 'fatalsToBrowser'; use IO::Socket; @@ -45,6 +45,7 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; +my %color = (); my %checked=(); my %selected=(); my %netsettings=(); @@ -55,8 +56,6 @@ my %dlinfo=(); my $id=0; my @dfdata=(); my $dfstr=''; -my $dudata=''; -my $dustr=''; my @updatelist=(); my @sources=(); my $sourceurl=''; @@ -64,7 +63,6 @@ my $vendorid=''; my $uuid=''; my $status=0; my $updatefile=''; -my $cachefile=''; my $shortname=''; my $time=''; my $filesize=0; @@ -80,11 +78,11 @@ my $cachehits=0; my $efficiency='0.0'; my @vendors=(); my %vendorstats=(); -my %vendimg = (); -my $repository = '/var/updatecache/'; -my $webhome = '/srv/web/ipfire/html'; -my $webimgdir = '/images/updbooster'; +my $repository = "/var/updatecache/"; +my $webhome = "/srv/web/ipfire/html"; +my $hintcolour = '#FFFFCC'; +my $colourgray = '#808080'; my $sfUnknown='0'; my $sfOk='1'; @@ -93,7 +91,7 @@ my $sfNoSource='3'; my $not_accessed_last=''; -my @errormessages=(); +my $errormessage=''; my @repositorylist=(); my @repositoryfiles=(); @@ -105,6 +103,7 @@ my @metadata=(); &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); $xlratorsettings{'ACTION'} = ''; $xlratorsettings{'ENABLE_LOG'} = 'off'; @@ -117,1305 +116,1451 @@ $xlratorsettings{'FULL_AUTOSYNC'} = 'off'; $xlratorsettings{'NOT_ACCESSED_LAST'} = 'month1'; $xlratorsettings{'REMOVE_NOSOURCE'} = 'off'; $xlratorsettings{'REMOVE_OUTDATED'} = 'off'; -$xlratorsettings{'REMOVE_UNKNOWN'} = 'off'; -$xlratorsettings{'REMOVE_TODELETE'} = 'off'; -$xlratorsettings{'TODELETE'} = 'off'; -$xlratorsettings{'show'} = ''; +$xlratorsettings{'REMOVE_OBSOLETE'} = 'off'; &Header::getcgihash(\%xlratorsettings); -# ------------------------------------------------------ -# Check if some ACTION is required -# ------------------------------------------------------ +$xlratorsettings{'EXTENDED_GUI'} = ''; + +if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>") +{ + $xlratorsettings{'EXTENDED_GUI'} = 'statistics'; +} + +if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>") +{ + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; +} + +if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr purge'}) +{ + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; + + if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on')) + { + undef (@sources); + undef @repositoryfiles; + foreach (<$repository/*>) + { + if (-d $_) + { + unless (/^$repository\/download$/) { push(@sources,$_); } + } + } + + foreach (@sources) + { + @updatelist=<$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $uuid = substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") + { + open (FILE,"$_/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + $updatefile = "$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } + } + + foreach (@repositoryfiles) + { + ($vendorid,$uuid,$updatefile) = split('/'); + + if (-e "$repository/$vendorid/$uuid/status") + { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata = ; + close FILE; + chomp(@metadata); + $status = $metadata[-1]; + } + + if (-e "$repository/$vendorid/$uuid/access.log") + { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata = ; + close FILE; + chomp(@metadata); + $lastaccess = $metadata[-1]; + } + + if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource)) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { 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 ($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 (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { 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 (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { 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 ($xlratorsettings{'ACTION'} eq $Lang::tr{'save'}) - { &chksettings('save',\@errormessages); - $xlratorsettings{'show'} = 'settings'; - } -elsif ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) - { &chksettings('saverestart',\@errormessages); - $xlratorsettings{'show'} = 'settings'; - } -elsif ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr cancel download'}) - { &canceldownload($xlratorsettings{'ID'}); - $xlratorsettings{'show'} = 'overview'; - } -elsif (($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr purge'}) - && (($xlratorsettings{'REMOVE_UNKNOWN'} eq 'on') - || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') - || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') - || ($xlratorsettings{'REMOVE_TODELETE'} eq 'on'))) - { &delolddata(); - $xlratorsettings{'show'} = 'maintenance'; - } +{ + if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100)) + { + $errormessage = $Lang::tr{'updxlrtr invalid disk usage'}; + goto ERROR; + } + if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) + { + $errormessage = $Lang::tr{'updxlrtr invalid download rate'}; + goto ERROR; + } -# ------------------------------------------------------ -# ACTION Check - End -# ------------------------------------------------------ + &savesettings; +} -$not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'}; -undef($xlratorsettings{'NOT_ACCESSED_LAST'}); +if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) +{ + if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100)) + { + $errormessage = $Lang::tr{'updxlrtr invalid disk usage'}; + goto ERROR; + } + if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) + { + $errormessage = $Lang::tr{'updxlrtr invalid download rate'}; + goto ERROR; + } + if ((!(-e "${General::swroot}/proxy/enable")) && (!(-e "${General::swroot}/proxy/enable_blue"))) + { + $errormessage = $Lang::tr{'updxlrtr web proxy service required'}; + goto ERROR; + } + if (!($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on')) + { + $errormessage = $Lang::tr{'updxlrtr not enabled'}; + goto ERROR; + } + + &savesettings; -if (-e "${General::swroot}/updatexlrator/settings") { - &General::readhash("${General::swroot}/updatexlrator/settings", \%xlratorsettings); + system('/usr/local/bin/squidctrl restart >/dev/null 2>&1'); } -if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '') { $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last; } +if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'}) +{ + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; -if ($xlratorsettings{'show'} eq 'overview') { $xlratorsettings{'EXTENDED_GUI'} = 'overview'; } -elsif ($xlratorsettings{'show'} eq 'statistics') { $xlratorsettings{'EXTENDED_GUI'} = 'statistics'; } -elsif ($xlratorsettings{'show'} eq 'settings') { $xlratorsettings{'EXTENDED_GUI'} = 'settings'; } -elsif ($xlratorsettings{'show'} eq 'maintenance') { $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; } -else { $xlratorsettings{'EXTENDED_GUI'} = $xlratorsettings{'VIEW_SETTING'}?$xlratorsettings{'VIEW_SETTING'}:'overview'; } + $updatefile = $xlratorsettings{'ID'}; -&initvendimg; + unless ($updatefile =~ /^download\//) + { + ($vendorid,$uuid,$updatefile) = split('/',$updatefile); + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } +} -# ---------------------------------------------------- -# Start Page Output -# ---------------------------------------------------- +if (($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr cancel download'}) || ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'})) +{ + $updatefile = $xlratorsettings{'ID'}; -&Header::showhttpheaders(); -&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, '' ); -&Header::openbigbox('100%', 'left', '', scalar(@errormessages)); + if ($updatefile =~ /^download\//) + { + ($uuid,$vendorid,$updatefile) = split('/',$updatefile); -# ===================================================================================== -# CACHE OVERVIEW -# ===================================================================================== + if (-e "$repository/download/$vendorid/$updatefile.info") + { + &General::readhash("$repository/download/$vendorid/$updatefile.info", \%dlinfo); -if ($xlratorsettings{'EXTENDED_GUI'} eq 'overview') { - &Header::openbox('100%', 'left', $Lang::tr{'updxlrtr cache overview'}); - &printfrmview(); - &printerrormsgs(\@errormessages); - &printtbldiskusage ($Lang::tr{'updxlrtr disk usage'},\$repository); - &initdownloaddata(\@downloadfiles); - &printtbldownloads(\@downloadfiles); - &Header::closebox(); - } + $id = &getPID("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$"); + if ($id) { system("/bin/kill -9 $id"); } + $id = &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"); + if ($id) { system("/bin/kill -9 $id"); } -# ===================================================================================== -# CACHE STATISTICS -# ===================================================================================== + system("rm $repository/download/$vendorid/$updatefile.info"); + } -if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') { - &Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}"); - &printfrmview(); - &printerrormsgs(\@errormessages); - &initcachestats(); - &printcachestatistics(); - &Header::closebox(); - } + if (-e "$repository/download/$vendorid/$updatefile") + { + system("rm $repository/download/$vendorid/$updatefile"); + } + } -# ===================================================================================== -# CACHE MAINTENANCE -# ===================================================================================== +} -if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') { - &Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}"); - &printfrmview(); - &printerrormsgs(\@errormessages); - &initfrmmaintenance(); - &inittblreposdata(); - &printfrmmaintenance('withfiles', \@repositoryfiles); - &Header::closebox(); - } +$not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'}; +undef($xlratorsettings{'NOT_ACCESSED_LAST'}); -# ===================================================================================== -# CACHE SETTINGS -# ===================================================================================== +if (-e "${General::swroot}/updatexlrator/settings") +{ + &General::readhash("${General::swroot}/updatexlrator/settings", \%xlratorsettings); +} -if ($xlratorsettings{'EXTENDED_GUI'} eq 'settings') { - &Header::openbox('100%', 'left', $Lang::tr{'updxlrtr cache settings'}); - &printfrmview(); - &printerrormsgs(\@errormessages); - &initfrmsettings(); - &printfrmsettings(); - &Header::closebox(); - } +if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '') +{ + $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last; +} + +ERROR: + +$checked{'ENABLE_LOG'}{'off'} = ''; +$checked{'ENABLE_LOG'}{'on'} = ''; +$checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} = "checked='checked'"; +$checked{'PASSIVE_MODE'}{'off'} = ''; +$checked{'PASSIVE_MODE'}{'on'} = ''; +$checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} = "checked='checked'"; +$checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} = ''; +$checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} = ''; +$checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}} = "checked='checked'"; +$checked{'ENABLE_AUTOCHECK'}{'off'} = ''; +$checked{'ENABLE_AUTOCHECK'}{'on'} = ''; +$checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} = "checked='checked'"; +$checked{'FULL_AUTOSYNC'}{'off'} = ''; +$checked{'FULL_AUTOSYNC'}{'on'} = ''; +$checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} = "checked='checked'"; +$checked{'REMOVE_NOSOURCE'}{'off'} = ''; +$checked{'REMOVE_NOSOURCE'}{'on'} = ''; +$checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} = "checked='checked'"; +$checked{'REMOVE_OUTDATED'}{'off'} = ''; +$checked{'REMOVE_OUTDATED'}{'on'} = ''; +$checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} = "checked='checked'"; +$checked{'REMOVE_OBSOLETE'}{'off'} = ''; +$checked{'REMOVE_OBSOLETE'}{'on'} = ''; +$checked{'REMOVE_OBSOLETE'}{$xlratorsettings{'REMOVE_OBSOLETE'}} = "checked='checked'"; + + +$selected{'AUTOCHECK_SCHEDULE'}{'daily'} = ''; +$selected{'AUTOCHECK_SCHEDULE'}{'weekly'} = ''; +$selected{'AUTOCHECK_SCHEDULE'}{'monthly'} = ''; +$selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = "selected='selected'"; + +$selected{'NOT_ACCESSED_LAST'}{'week'} = ''; +$selected{'NOT_ACCESSED_LAST'}{'month1'} = ''; +$selected{'NOT_ACCESSED_LAST'}{'month3'} = ''; +$selected{'NOT_ACCESSED_LAST'}{'month6'} = ''; +$selected{'NOT_ACCESSED_LAST'}{'year'} = ''; +$selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selected='selected'"; # ---------------------------------------------------- -# End Page Output +# Settings dialog # ---------------------------------------------------- -&Header::closebigbox(); -&Header::closepage(); -# ------------------------------------------------------------------- -# Print Form to switch view -# ------------------------------------------------------------------- +&Header::showhttpheaders(); -sub printfrmview { - print < -
-$Lang::tr{'updxlrtr current view'}: +&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, ''); + +&Header::openbigbox('100%', 'left', '', $errormessage); + +if ($errormessage) { + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + print "$errormessage \n"; + &Header::closebox(); +} + +print "
\n"; + +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr update accelerator'}"); + +print < + + $Lang::tr{'updxlrtr common settings'} + + + $Lang::tr{'updxlrtr enable log'}: + + + + + + $Lang::tr{'updxlrtr passive mode'}: + + $Lang::tr{'updxlrtr max disk usage'}: + % + + +
+ + + + + + + + + +
$Lang::tr{'updxlrtr performance options'}
$Lang::tr{'updxlrtr low download priority'}:$Lang::tr{'updxlrtr max download rate'}: * +
+
+ + + + + + + + + + + + + + + + +
$Lang::tr{'updxlrtr source checkup'}
$Lang::tr{'updxlrtr enable autocheck'}:$Lang::tr{'updxlrtr source checkup schedule'}: + +
$Lang::tr{'updxlrtr full autosync'}:  
+
+ + + + + END ; - if ($xlratorsettings{'EXTENDED_GUI'} eq 'overview') - { print "\n"; } - else - { print "\n"; } - - if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') - { print "\n"; } - else - { print "\n"; } - - if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') - { print "\n"; } - else - { print "\n"; } - - if ($xlratorsettings{'EXTENDED_GUI'} eq 'settings') - { print "\n"; } - else - { print "\n"; } - print < - + +print" \n"; + +print" \n"; + +print < +
 >' "; } +print "/>>' "; } +print "/>
END ; - return; -} -# ------------------------------------------------------------------- -# Print Error Messages - printerrormsgs(\@errormsgs) -# ------------------------------------------------------------------- +&Header::closebox(); + +print "\n"; + +# ---------------------------------------------------- +# 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'}"); -sub printerrormsgs { - my $errmsgs_ref = shift; - unless (@$errmsgs_ref == 0) { - &Header::openbox('100%', 'left', ''); print <$Lang::tr{'error messages'}
+ + +
$Lang::tr{'updxlrtr current downloads'}
+ + + + + + + + + + + + + + END ; - foreach (@$errmsgs_ref) { print "$_
"; } - undef(@$errmsgs_ref); - print "\t\t\t\n"; - &Header::closebox(); - } -} + $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 "\n"; } + else { + print "\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\n"; + } else { + print "$Lang::tr{ \n"; + } -# ------------------------------------------------------------------- -# Initialize Downloaddata -# ------------------------------------------------------------------- + print "\t\t\n"; + } else { + print "" . ucfirst $vendorid . " \n"; + } -# ------------------------------------------------------------------- -# Print pending Downloadlist -# ------------------------------------------------------------------- + $shortname = substr($updatefile,rindex($updatefile,"/")+1); + $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; -sub printtbldownloads { - my $dllist_ref = shift; - print < - - - - - - - - - - - - - - - + + + + - - -END -; - &printtbldldata($dllist_ref); - print < -
 $Lang::tr{'updxlrtr source'}$Lang::tr{'updxlrtr filename'}$Lang::tr{'updxlrtr filesize'}$Lang::tr{'date'}$Lang::tr{'updxlrtr progress'} 
 "; + if (&getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$")) + { + print "$Lang::tr{  "; -sub initdownloaddata { - @downloadlist = <$repository/download/*>; - my $updfile; - my $dlfiles_ref = shift; - undef(@$dlfiles_ref); - foreach (@downloadlist) { - if (-d) { - my @filelist = <$_/*>; - $vendorid = substr($_,rindex($_,"/")+1); - foreach(@filelist) { - next if(/\.info$/); - $updfile = substr($_,rindex($_,"/")+1); - $updfile .= ":download/$vendorid/$updfile"; - $updfile = " ".$updfile; - push(@$dlfiles_ref, $updfile); - } - } - } -} + if (($vendorid ne '') && (-e "$webhome/images/updbooster/updxl-src-$vendorid.gif")) + { + print "" . ucfirst $vendorid . " 
$Lang::tr{'updxlrtr current downloads'}
$Lang::tr{'status'}$Lang::tr{'updxlrtr source'}$Lang::tr{'updxlrtr filename'}$Lang::tr{'updxlrtr filesize'}$Lang::tr{'date'}$Lang::tr{'updxlrtr progress'} 
+ $filesize = $dlinfo{'REMOTESIZE'}; + 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; + $dlinfo{'VENDORID'} = ucfirst $vendorid; + + print < $dlinfo{'VENDORID'} $shortname $filesize  $filedate  END ; - &printlegenddownload(); - print < + +
+ + + +
END ; + } + + print "\n
\n\n"; + &printlegenddownload(); + print "
\n"; + + &Header::closebox(); + } } +# ===================================================================================== +# CACHE STATISTICS +# ===================================================================================== -# ------------------------------------------------------------------- -# Print Download Files - printdlfiles(\@dlfiles) -# ------------------------------------------------------------------- +if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') +{ -sub printtbldldata { - my $dlfiles_ref = shift; - unless (@$dlfiles_ref) - { print "\n".$Lang::tr{'updxlrtr no pending downloads attime'}."\n\n"; } - else { - $id = 0; - foreach $updatefile (@$dlfiles_ref) { - print "\n"; - $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); } - - $filesize = $size_updatefile; - 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; - my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime); - my $percent = '0'; - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - $filedate = $DAYdt.".".$MONTHdt.".".$YEARdt; - ($uuid,$vendorid,$shortname) = split('/',$updatefile); - $shortname = substr($updatefile,rindex($updatefile,"/")+1); - $shortname =~ s/(.*)_([\da-f]{8})*(\.(exe|cab|psf|msu)$)/$1_$2*$3/i; - unless (length($shortname) <= 50) { - my $fext = substr($shortname,rindex("$shortname",'.')); - $shortname = substr($shortname,0,44-length($fext)); - $shortname .= "[...] $fext"; - } - $filesize = $dlinfo{'REMOTESIZE'}; - 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; - $dlinfo{'VENDORID'} = ucfirst $vendorid; - if ($dlinfo{'REMOTESIZE'} && $size_updatefile) { $percent = int(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile)); } - - if (&getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$")) - { print '\n"; } - else { print '\n"; } - - if ($vendimg{$vendorid}) - { print ''.ucfirst $dlinfo{'VENDORID'}."\n"; } - else { print ''.ucfirst $dlinfo{'VENDORID'}."\n"; } - print <$shortname -$filesize -$filedate - -END -; - &percentbar($percent); - print < - -
-
- - - -
-
- - -END -; - $id += 1; - } - } +# ---------------------------------------------------- +# Get statistics +# ---------------------------------------------------- + +@sources=(); +foreach (<$repository/*>) +{ + if (-d $_) + { + unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/)) { push(@sources,$_); } + } } -# ------------------------------------------------------------------- -# Initialize Cachestats -# ------------------------------------------------------------------- +@vendors=(); +foreach (@sources) +{ + $vendorid=substr($_,rindex($_,'/')+1,length($_)); + push(@vendors,$vendorid); + $vendorstats{$vendorid."_filesize"} = 0; + $vendorstats{$vendorid."_requests"} = 0; + $vendorstats{$vendorid."_files"} = 0; + $vendorstats{$vendorid."_cachehits"} = 0; + $vendorstats{$vendorid."_0"} = 0; + $vendorstats{$vendorid."_1"} = 0; + $vendorstats{$vendorid."_2"} = 0; + $vendorstats{$vendorid."_3"} = 0; + @updatelist=<$_/*>; + foreach $data (@updatelist) + { + if (-e "$data/source.url") + { + open (FILE,"$data/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + + my $size_updatefile = 0; + if(-e "$data/$updatefile") { + $size_updatefile = (-s "$data/$updatefile"); + } + else + { + # DEBUG + #die "file not found: $data/$updatefile\n"; + } + # + # Total file size + # + $filesize += $size_updatefile; + # + # File size for this source + # + $vendorstats{$vendorid."_filesize"} += $size_updatefile; + # + # Number of requests from cache for this source + # + open (FILE,"$data/access.log"); + @requests=; + close FILE; + chomp(@requests); + $counts = @requests; + $counts--; + $vendorstats{$vendorid."_requests"} += $counts; + $cachehits += $counts; + # + # Total number of files in cache + # + $numfiles++; + # + # Number of files for this source + # + $vendorstats{$vendorid."_files"}++; + # + # Count cache status occurences + # + open (FILE,"$data/status"); + $_=; + close FILE; + chomp; + $vendorstats{$vendorid."_".$_}++; + # + # Calculate cached traffic for this source + # + $vendorstats{$vendorid."_cachehits"} += $counts * $size_updatefile; + # + # Calculate total cached traffic + # + $cachedtraffic += $counts * $size_updatefile; -sub initcachestats { - @sources=(); - foreach (<$repository/*>) { - if (-d $_) { - unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/)) { push(@sources,$_); } - } - } - @vendors=(); - foreach (@sources) - { - $vendorid=substr($_,rindex($_,'/')+1,length($_)); - push(@vendors,$vendorid); - $vendorstats{$vendorid."_filesize"} = 0; - $vendorstats{$vendorid."_requests"} = 0; - $vendorstats{$vendorid."_files"} = 0; - $vendorstats{$vendorid."_cachehits"} = 0; - $vendorstats{$vendorid."_0"} = 0; - $vendorstats{$vendorid."_1"} = 0; - $vendorstats{$vendorid."_2"} = 0; - $vendorstats{$vendorid."_3"} = 0; - @updatelist=<$_/*>; - foreach $data (@updatelist) { - if (-e "$data/source.url") { - open (FILE,"$data/source.url"); - $sourceurl=; - close FILE; - chomp($sourceurl); - $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); - my $size_updatefile = 0; - if(-e "$data/$updatefile") { - $size_updatefile = (-s "$data/$updatefile"); - } - else { - # DEBUG - #die "file not found: $data/$updatefile\n"; - } - # - # Total file size - # - $filesize += $size_updatefile; - # - # File size for this source - # - $vendorstats{$vendorid."_filesize"} += $size_updatefile; - # - # Number of requests from cache for this source - # - open (FILE,"$data/access.log"); - @requests=; - close FILE; - chomp(@requests); - $counts = @requests; - $counts--; - $vendorstats{$vendorid."_requests"} += $counts; - $cachehits += $counts; - # - # Total number of files in cache - # - $numfiles++; - # - # Number of files for this source - # - $vendorstats{$vendorid."_files"}++; - # - # Count cache status occurences - # - open (FILE,"$data/status"); - $_=; - close FILE; - chomp; - $vendorstats{$vendorid."_".$_}++; - # - # Calculate cached traffic for this source - # - $vendorstats{$vendorid."_cachehits"} += $counts * $size_updatefile; - # - # Calculate total cached traffic - # - $cachedtraffic += $counts * $size_updatefile; - } - } - } - if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); } + } + } } +if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); } + +1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; +1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/; + # ---------------------------------------------------- -# Print statistics +# Show statistics # ---------------------------------------------------- -sub printcachestatistics { - if ($numfiles) { - $filesize = &format_size($filesize); - $cachedtraffic = &format_size($cachedtraffic); - print < -$Lang::tr{'updxlrtr summary'} - - - $Lang::tr{'updxlrtr total files'}: - $numfiles - $Lang::tr{'updxlrtr total cache size'}: - $filesize - - - $Lang::tr{'updxlrtr efficiency index'}: - $efficiency - $Lang::tr{'updxlrtr total data from cache'}: - $cachedtraffic - - +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}"); + +unless ($numfiles) { print "$Lang::tr{'updxlrtr empty repository'}\n
\n"; } + +print < +$Lang::tr{'updxlrtr disk usage'} -
- - ------- - - - - - - - - - - - - - - - +
$Lang::tr{'updxlrtr statistics by source'}
$Lang::tr{'updxlrtr source'}$Lang::tr{'updxlrtr files'}$Lang::tr{'updxlrtr cache size'}$Lang::tr{'updxlrtr data from cache'}
+ + + + + + + + END ; - &printlegendstatus(); - print < - - - + +open(DF,"/bin/df -h $repository|"); +@dfdata = ; +close DF; +shift(@dfdata); +chomp(@dfdata); +$dfstr = join(' ',@dfdata); +my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + +print < + + + + + + +
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free END ; - &printtblstatdata(\@vendors); +&percentbar($percent); +print < +$percent
+END +; + +if ($numfiles) +{ print < +
+ + + + + + + + + + + + + + + + + +
$Lang::tr{'updxlrtr summary'}
$Lang::tr{'updxlrtr total files'}:$numfiles$Lang::tr{'updxlrtr total cache size'}:$filesize
$Lang::tr{'updxlrtr efficiency index'}:$efficiency$Lang::tr{'updxlrtr total data from cache'}:$cachedtraffic
+
+ + + + + + + + + + + + + + + + + + + + + + END ; -} -sub printtblstatdata { - my $vendlst_ref = shift; - my $vendorid; - $id = 0; - unless (@$vendlst_ref) { print "\n\n\n"; } +$id = 0; + +foreach (@vendors) +{ + $vendorid = $_; + + unless ($vendorstats{$vendorid . "_files"}) { next; } + + $id++; + if ($id % 2) { + print "\n"; } else { - foreach (@$vendlst_ref) { - $vendorid = $_; - unless ($vendorstats{$vendorid . "_files"}) { next; } - print "\t\n"; - if ($vendimg{$vendorid}) - { print "\t\t\n"; } - else { print "\t\t\n"; } - print "\t\t\n"; - unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; } - print "\t\t\n"; - unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; } - print "\t\t\n"; - print "\t\t\n"; - print "\t\t\n"; - print "\t\t\n"; - print "\t\t\n"; - print "\t\n"; - $id += 1; + print "\n"; } + + print "\n"; + print "\n"; + } elsif ($vendorid =~ /^Microsoft$/i) + { + print "Microsoft \n"; + print "\n"; + } elsif ($vendorid =~ /^Symantec$/i) + { + print "Symantec \n"; + print "\n"; + } elsif ($vendorid =~ /^Linux$/i) + { + print "Linux \n"; + print "\n"; + } elsif ($vendorid =~ /^TrendMicro$/i) + { + print "Trend Micro \n"; + print "\n"; + } elsif ($vendorid =~ /^Apple$/i) + { + print "Apple \n"; + print "\n"; + } elsif ($vendorid =~ /^Avast$/i) + { + print "Avast \n"; + print "\n"; + } elsif ($vendorid =~ /^Avira$/i) + { + print "Avira \n"; + print "\n"; + } elsif ($vendorid =~ /^AVG$/i) + { + print "AVG \n"; + print "\n"; + } elsif ($vendorid =~ /^Ipfire$/i) + { + print "IPFire \n"; + print "\n"; + } else + { + if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif") + { + print "" . ucfirst $vendorid . " \n"; + } else { + print "" . ucfirst $vendorid . " \n"; } + print "\n"; } - } -} -# ------------------------------------------------------------------- -# Initialize Repositorydata -# ------------------------------------------------------------------- -sub inittblreposdata { - @sources = <$repository/download/*>; - undef @repositoryfiles; - foreach (@sources) { - if (-d) { - @updatelist = <$_/*>; - $vendorid = substr($_,rindex($_,"/")+1); - foreach(@updatelist) { - next if(/\.info$/); - $updatefile = substr($_,rindex($_,"/")+1); - $updatefile .= ":download/$vendorid/$updatefile"; - $updatefile = " ".$updatefile; - push(@repositoryfiles,$updatefile); - } - } - } + print "\n"; - undef (@sources); - foreach (<$repository/*>) { - if (-d $_) { - unless (/^$repository\/download$/) { push(@sources,$_); } - } - } + unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; } + 1 while $vendorstats{$vendorid."_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + print "\n"; - foreach (@sources) { - @updatelist=<$_/*>; - $vendorid = substr($_,rindex($_,"/")+1); - foreach(@updatelist) { - $uuid = substr($_,rindex($_,"/")+1); - if (-e "$_/source.url") { - open (FILE,"$_/source.url"); - $sourceurl=; - close FILE; - chomp($sourceurl); - $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); - $_ = $updatefile; tr/[A-Z]/[a-z]/; - $updatefile = "$_:$vendorid/$uuid/$updatefile"; - push(@repositoryfiles,$updatefile); - } - } - } - @repositoryfiles = sort { ($a =~ /.*?:(.*\/).*?/)[0] cmp ($b =~ /.*?:(.*\/).*?/)[0] } @repositoryfiles; -} + unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; } + 1 while $vendorstats{$vendorid."_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + print "\n"; -# ------------------------------------------------------------------- -# Initialize Cache-Maintenance Form -# ------------------------------------------------------------------- + print "\n"; -sub initfrmmaintenance { - $selected{'NOT_ACCESSED_LAST'}{'week'} = ''; - $selected{'NOT_ACCESSED_LAST'}{'month1'} = ''; - $selected{'NOT_ACCESSED_LAST'}{'month3'} = ''; - $selected{'NOT_ACCESSED_LAST'}{'month6'} = ''; - $selected{'NOT_ACCESSED_LAST'}{'year'} = ''; - $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selected='selected'"; - $checked{'REMOVE_NOSOURCE'}{'off'} = ''; - $checked{'REMOVE_NOSOURCE'}{'on'} = ''; - $checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} = "checked='checked'"; - $checked{'REMOVE_OUTDATED'}{'off'} = ''; - $checked{'REMOVE_OUTDATED'}{'on'} = ''; - $checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} = "checked='checked'"; - $checked{'REMOVE_UNKNOWN'}{'off'} = ''; - $checked{'REMOVE_UNKNOWN'}{'on'} = ''; - $checked{'REMOVE_UNKNOWN'}{$xlratorsettings{'REMOVE_UNKNOWN'}} = "checked='checked'"; - $checked{'REMOVE_TODELETE'}{'off'} = ''; - $checked{'REMOVE_TODELETE'}{'on'} = ''; - $checked{'REMOVE_TODELETE'}{$xlratorsettings{'REMOVE_TODELETE'}} = "checked='checked'"; - $checked{'TODELETE'}{'off'} = ''; - $checked{'TODELETE'}{'on'} = ''; - $checked{'TODELETE'}{$xlratorsettings{'TODELETE'}} = "checked='checked'"; + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; } -# ------------------------------------------------------------------- -# Print Cache-Maintenance Form - printfrmmaintenance('withfiles', \@repositoryfiles) -# ------------------------------------------------------------------- +print "
$Lang::tr{'updxlrtr statistics by source'}
$Lang::tr{'updxlrtr source'} $Lang::tr{'updxlrtr files'} $Lang::tr{'updxlrtr cache size'} $Lang::tr{'updxlrtr data from cache'}     
$Lang::tr{'updxlrtr empty repository'}.
". ucfirst $vendorid ."". ucfirst $vendorid .""; - printf "%5d", $vendorstats{$vendorid."_files"}; - print ""; - print &format_size($vendorstats{$vendorid."_filesize"}); - print ""; - print &format_size($vendorstats{$vendorid."_cachehits"}); - print ""; - printf "%5d", $vendorstats{$vendorid."_1"}; - print ""; - printf "%5d", $vendorstats{$vendorid."_3"}; - print ""; - printf "%5d", $vendorstats{$vendorid."_2"}; - print ""; - printf "%5d", $vendorstats{$vendorid."_0"}; - print "
 "; + + if ($vendorid =~ /^Adobe$/i) + { + print "Adobe  Adobe  Microsoft  Symantec  Linux  Trend Micro  Apple  Avast  Avira  AVG  IPFire  " . ucfirst $vendorid . " "; + printf "%5d", $vendorstats{$vendorid."_files"}; + print " "; + printf "%15s", $vendorstats{$vendorid."_filesize"}; + print " "; + printf "%15s", $vendorstats{$vendorid."_cachehits"}; + print " "; + printf "%5d", $vendorstats{$vendorid."_1"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_3"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_2"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_0"}; + print "   
\n"; -sub printfrmmaintenance { - my $param = shift; - my $repos_ref = shift; - my $disabled = ''; - unless (@$repos_ref) { $disabled = "disabled='disabled'"; } - print < -
- $Lang::tr{'updxlrtr all files'} - - - -
-
- $Lang::tr{'updxlrtr marked as'} ... - - - - - - - - -
-
- -
+print < + + + + + + + + + + + + + + + + + +
  $Lang::tr{'legend'}: $Lang::tr{$Lang::tr{'updxlrtr condition ok'}   $Lang::tr{$Lang::tr{'updxlrtr condition nosource'}   $Lang::tr{$Lang::tr{'updxlrtr condition outdated'}   $Lang::tr{$Lang::tr{'updxlrtr condition unknown'}   
END ; - if ($param =~ /withfiles/i) - { &printtblrepository($Lang::tr{'updxlrtr current files'}, $repos_ref); } - print "\n"; + } -# ------------------------------------------------------------------- -# Print current files in repository - printreposfiles($title, \@files) -# ------------------------------------------------------------------- +&Header::closebox(); -sub printtblrepository { - my $title = shift; - my $files = shift; - - print < - - ------ - - - - - - - - - - - - - - - +
$title
$Lang::tr{'status'}$Lang::tr{'updxlrtr source'}$Lang::tr{'updxlrtr filename'}$Lang::tr{'updxlrtr filesize'}$Lang::tr{'date'}
+} + +# ===================================================================================== +# CACHE MAINTENANCE +# ===================================================================================== + +if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') +{ + + +# ---------------------------------------------------- +# File list dialog +# ---------------------------------------------------- + +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}"); + +@sources= <$repository/download/*>; + +undef @repositoryfiles; +foreach (@sources) +{ + if (-d) + { + @updatelist = <$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + next if(/\.info$/); + $updatefile = substr($_,rindex($_,"/")+1); + $updatefile .= ":download/$vendorid/$updatefile"; + $updatefile = " ".$updatefile; + push(@repositoryfiles,$updatefile); + } + } +} + +undef (@sources); +foreach (<$repository/*>) +{ + if (-d $_) +{ + unless (/^$repository\/download$/) { push(@sources,$_); } + } +} + +foreach (@sources) +{ + @updatelist=<$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $uuid = substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") + { + open (FILE,"$_/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + $_ = $updatefile; tr/[A-Z]/[a-z]/; + $updatefile = "$_:$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } +} + +@repositoryfiles = sort(@repositoryfiles); + +unless (@repositoryfiles) { print "$Lang::tr{'updxlrtr empty repository'}\n
\n"; } + +print < +
$Lang::tr{'updxlrtr disk usage'}
+ + + + + + + + END ; -&printlegendicons(); -&printlegendstatus(); -&printlegendsource(); + +open(DF,"/bin/df -h $repository|"); +@dfdata = ; +close DF; +shift(@dfdata); +chomp(@dfdata); +$dfstr = join(' ',@dfdata); +my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + print < - - - + + + + + +\n\t\t\n\t\n"; } - else { - $id = 0; - foreach $updatefile (@$files) { - $updatefile =~ s/.*://; - my $size_updatefile = 0; - my $mtime = 0; - if(-e "$repository/$updatefile") { - $size_updatefile = (-s "$repository/$updatefile"); - $mtime = &getmtime("$repository/$updatefile"); - } - print "\t\n"; - $filesize = &format_size($size_updatefile); - my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime); - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - $filedate = $DAYdt.".".$MONTHdt.".".$YEARdt; - $lastaccess = "n/a"; - $lastcheck = "n/a"; - $status = $sfUnknown; - unless ($updatefile =~ /^download\//) { - ($vendorid,$uuid,$shortname) = split('/',$updatefile); - if (-e "$repository/$vendorid/$uuid/access.log") { - open (FILE,"$repository/$vendorid/$uuid/access.log"); - @metadata = ; - close(FILE); - chomp @metadata; - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) - { $lastaccess = $DAYdt.".".$MONTHdt.".".$YEARdt; } - } - if (-e "$repository/$vendorid/$uuid/checkup.log") { - open (FILE,"$repository/$vendorid/$uuid/checkup.log"); - @metadata = ; - close(FILE); - chomp @metadata; - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) - { $lastcheck = $DAYdt.".".$MONTHdt.".".$YEARdt; } - } - if (-e "$repository/$vendorid/$uuid/status") { - open (FILE,"$repository/$vendorid/$uuid/status"); - @metadata = ; - close(FILE); - chomp @metadata; - $status = $metadata[-1]; - } - } - else { - ($uuid,$vendorid,$shortname) = split('/',$updatefile); - $status = $sfOutdated; - } - - if ($status == $sfUnknown) - { print "\t\t\n"; } - elsif ($status == $sfOk) - { print "\t\t\n"; } - elsif ($status == $sfNoSource) - { print "\t\t\n"; } - elsif (($status == $sfOutdated) && (!($updatefile =~ /^download\//i))) - { print "\t\t\n"; } - elsif (($status == $sfOutdated) && ($updatefile =~ /^download\//i)) - { print "\t\t\n"; } - if ($vendimg{$vendorid}) { - print "\t\t\n"; } - else { - print "\t\t\n"; - } - $shortname = substr($updatefile,rindex($updatefile,"/")+1); - unless ($vendorid ne 'microsoft') { $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1\[...\] $2/i; } - unless (length($shortname) <= 50) { - my $fext = substr($shortname,rindex("$shortname",'.')); - $shortname = substr($shortname,0,44-length($fext)); - $shortname .= "[...] $fext"; - } - print <$shortname - - - - - - +&percentbar($percent); +print < + + +
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free END ; - unless (@$files) { print "\t
$Lang::tr{'updxlrtr empty repository'}.
       $filesize$filedate$lastaccess$lastcheck
$percent
END ; - $id += 1; - } - } - print < + +if (@repositoryfiles) +{ + print < +
+ + + + + + + + + + + + + + + +
 $Lang::tr{'updxlrtr all files'} +  $Lang::tr{'updxlrtr not accessed'} + + +
+  $Lang::tr{'updxlrtr marked as'} + $Lang::tr{[$Lang::tr{'updxlrtr condition nosource'}] +  $Lang::tr{'updxlrtr marked as'} + $Lang::tr{[$Lang::tr{'updxlrtr condition outdated'}]
+
END ; + + &printcurrentfiles($Lang::tr{'updxlrtr current files'}, @repositoryfiles); + print "
\n\n"; + &printlegendicons(); + &printlegendspacer(); + &printlegendstatus(); + &printlegendspacer(); + &printlegendsource(); + print "
\n"; } -# ------------------------------------------------------------------- -# cancels pending download - need updatefile(-ID) -# ------------------------------------------------------------------- +&Header::closebox(); -sub canceldownload { - $updatefile = shift; - if ($updatefile =~ /^download\//) { - ($uuid,$vendorid,$updatefile) = split('/',$updatefile); - if (-e "$repository/download/$vendorid/$updatefile.info") { - &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"); } - $id = &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"); - if ($id) { system("/bin/kill -9 $id"); } - system("rm \"$repository/download/$vendorid/$updatefile.info\""); - } - - if (-e "$repository/download/$vendorid/$updatefile") { - system("rm \"$repository/download/$vendorid/$updatefile\""); - } - } } -# ------------------------------------------------------------------- -# Delete old and selected cached files +# ===================================================================================== + +&Header::closebigbox(); + +&Header::closepage(); + # ------------------------------------------------------------------- -sub delolddata { - undef (@sources); - undef @repositoryfiles; - foreach (<$repository/*>) { - if (-d $_) { - unless (/^$repository\/download$/) { push(@sources,$_); } - } - } - - foreach (@sources) { - @updatelist=<$_/*>; - $vendorid = substr($_,rindex($_,"/")+1); - foreach(@updatelist) { - $uuid = substr($_,rindex($_,"/")+1); - if (-e "$_/source.url") { - open (FILE,"$_/source.url"); - $sourceurl=; - close FILE; - chomp($sourceurl); - $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); - $updatefile = "$vendorid/$uuid/$updatefile"; - push(@repositoryfiles,$updatefile); - } - } - } - - foreach (@repositoryfiles) { - ($vendorid,$uuid,$updatefile) = split('/'); - if (-e "$repository/$vendorid/$uuid/status") { - open (FILE,"$repository/$vendorid/$uuid/status"); - @metadata = ; - close FILE; - chomp(@metadata); - $status = $metadata[-1]; - } - - if (-e "$repository/$vendorid/$uuid/access.log") { - open (FILE,"$repository/$vendorid/$uuid/access.log"); - @metadata = ; - close FILE; - chomp(@metadata); - $lastaccess = $metadata[-1]; - } - - if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource)) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { 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 (($xlratorsettings{'REMOVE_UNKNOWN'} eq 'on') && ($status == $sfUnknown)) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } +sub printcurrentfiles +{ + my $title = shift; + my @files = @_; - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800))) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } - elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600))) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } - elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800))) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } - elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600))) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } - elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000))) { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } + print < +
$Lang::tr{'updxlrtr current files'}
+ + + + + + + + + + + + + + + +END +; + $id = 0; + foreach $updatefile (@files) + { + $updatefile =~ s/.*://; + my $size_updatefile = 0; + my $mtime = 0; + if(-e "$repository/$updatefile") { + $size_updatefile = (-s "$repository/$updatefile"); + $mtime = &getmtime("$repository/$updatefile"); + } - - if (($xlratorsettings{'REMOVE_TODELETE'} eq 'on') && ($xlratorsettings{'TODELETE'} ne 'off')) { - my @todelete = split(/\|/, $xlratorsettings{'TODELETE'}); - foreach (@todelete) { - unless ($_ =~ /^download\//) { - ($vendorid,$uuid,$cachefile) = split(/\//, $_); - if (-e "$repository/$vendorid/$uuid/$cachefile") { system("rm -r \"$repository/$vendorid/$uuid\""); } - } - } - } - } -} + $id++; + if ($id % 2) { + print "\n"; } + else { + print "\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; + + $lastaccess = "n/a"; + $lastcheck = "n/a"; + + $status = $sfUnknown; + + unless ($updatefile =~ /^download\//) + { + ($vendorid,$uuid,$shortname) = split('/',$updatefile); + + if (-e "$repository/$vendorid/$uuid/access.log") + { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata = ; + close(FILE); + chomp @metadata; + + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; } + } + if (-e "$repository/$vendorid/$uuid/checkup.log") + { + open (FILE,"$repository/$vendorid/$uuid/checkup.log"); + @metadata = ; + close(FILE); + chomp @metadata; + + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; } + } + if (-e "$repository/$vendorid/$uuid/status") + { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata = ; + close(FILE); + chomp @metadata; + $status = $metadata[-1]; + } + } else { + ($uuid,$vendorid,$shortname) = split('/',$updatefile); + $status = $sfOutdated; + } + print "\t\t\n"; + } + if ($status == $sfOk) + { + print "$Lang::tr{ \n"; + } + if ($status == $sfNoSource) + { + print "$Lang::tr{ \n"; + } + if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i))) + { + print "$Lang::tr{ \n"; + } + if (($status == $sfOutdated) && ($updatefile =~ /^download\//i)) + { + print "$Lang::tr{ \n"; + } -# ------------------------------------------------------------------- + print "\t\t\n"; + } elsif ($vendorid =~ /^Microsoft$/i) + { + print "Microsoft \n"; + } elsif ($vendorid =~ /^Symantec$/i) + { + print "Symantec \n"; + } elsif ($vendorid =~ /^Linux$/i) + { + print "Linux \n"; + } elsif ($vendorid =~ /^TrendMicro$/i) + { + print "Trend Micro \n"; + } elsif ($vendorid =~ /^Apple$/i) + { + print "Apple \n"; + } elsif ($vendorid =~ /^Avast$/i) + { + print "Avast \n"; + } elsif ($vendorid =~ /^Avira$/i) + { + print "Avira \n"; + } elsif ($vendorid =~ /^AVG$/i) + { + print "AVG \n"; + } elsif ($vendorid =~ /^Ipfire$/i) + { + print "IPFire \n"; + } + else + { + if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif") + { + print "" . ucfirst $vendorid . " \n"; + } else { + print "" . ucfirst $vendorid . " \n"; + } + } + + $shortname = substr($updatefile,rindex($updatefile,"/")+1); + $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; -sub printlegenddownload { - print <$Lang::tr{'legend'}: -
    -
  • $Lang::tr{'updxlrtr condition download'}
  • -
  • $Lang::tr{'updxlrtr condition suspended'}
  • -
  • $Lang::tr{'updxlrtr cancel download'}
  • -
+print <$shortname +
+ + + + + END ; + } + + print "
  $Lang::tr{'updxlrtr filename'}$Lang::tr{'updxlrtr filesize'}$Lang::tr{'date'}$Lang::tr{$Lang::tr{ 
 "; + if ($status == $sfUnknown) + { + print "$Lang::tr{  "; + if ($vendorid =~ /^Adobe$/i) + { + print "Adobe  $filesize  $filedate  $lastaccess  $lastcheck  +
+ + + +
+
\n"; + } # ------------------------------------------------------------------- -sub printlegendicons { - print <$Lang::tr{'legend'}: -
    -
  • $Lang::tr{'updxlrtr last access'}
  • -
  • $Lang::tr{'updxlrtr last checkup'}
  • -
  • $Lang::tr{'updxlrtr remove file'}
  • -
+sub printlegenddownload +{ + print < +   $Lang::tr{'legend'}: +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition download'} +   +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition suspended'} +   +   + $Lang::tr{ + $Lang::tr{'updxlrtr cancel download'} + END ; } # ------------------------------------------------------------------- -sub printlegendstatus { - print <$Lang::tr{'status'}: -
    -
  • $Lang::tr{'updxlrtr condition ok'}
  • -
  • $Lang::tr{'updxlrtr condition nosource'}
  • -
  • $Lang::tr{'updxlrtr condition outdated'}
  • -
  • $Lang::tr{'updxlrtr condition download'}
  • -
  • $Lang::tr{'updxlrtr condition unknown'}
  • -
+sub printlegendicons +{ + print < +   $Lang::tr{'legend'}: +   + $Lang::tr{ + $Lang::tr{'updxlrtr last access'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr last checkup'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr remove file'} +   +   +   + END ; } # ------------------------------------------------------------------- -sub printlegendsource { - print <$Lang::tr{'updxlrtr sources'}: -
    +sub printlegendstatus +{ + print < +   $Lang::tr{'status'}: +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition ok'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition nosource'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition outdated'} +   +   + +   + + +   +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition download'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition unknown'} +   +   +   +   +   + +   + END ; - foreach my $name (sort keys %vendimg) { - if ($name =~ /^unknown$/i) { - print "\t
  • ". ucfirst $Lang::tr{$name} ."
  • \n"; - } else { - print "\t
  • ". ucfirst $name ."
  • \n"; - } - } - print "
\n"; } # ------------------------------------------------------------------- -# 2012-12-18: -# Seaching updbooster-image dir for all available images of format "updxl-src-.gif" -# Build a hash in format '' -> '/images/updbooster/updxl-src-.gif' - -sub initvendimg { - if (opendir(DIR, "$webhome$webimgdir")) { - my @files = grep { /updxl-src-/ } readdir(DIR); - my @vendor = (); - closedir(DIR); - foreach (@files) { - @vendor = split (/[.-]/, $_); - $vendimg{$vendor[2]} = "$webimgdir/$_"; - } - } - else { - die "updxlrtr: Can't access \"$webhome$webimgdir\". Error was: $!\n"; - } -} -# ------------------------------------------------------------------- -sub printtbldiskusage { - my $tabletitle = shift; - my $repos_ref=shift; - print < -$tabletitle - +sub printlegendsource +{ + print < + + + +   $Lang::tr{'updxlrtr source'}: +   + Adobe + Adobe +   + Apple + Apple +   + Avast + Avast +   + Linux + Linux + - $Lang::tr{'updxlrtr cache dir'} - $Lang::tr{'size'} - $Lang::tr{'updxlrtr total used'} - $Lang::tr{'updxlrtr used by'}
[$repository] - $Lang::tr{'free'} - $Lang::tr{'percentage'} + - -END -; - open(DF,"/bin/df -h $repository|"); - @dfdata = ; - $dudata = `/usr/bin/du -hs $repository`; - close DF; - shift(@dfdata); - chomp(@dfdata); - chomp($dudata); - $dfstr = join(' ',@dfdata); - my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); - my ($duused,$tmp) = split(' ',$dudata); - print < - [$repository] - $size - $used - $duused - $free - -END -; - &percentbar(&cpof($duused,$size),&cpof($used,$size)); - print < +   +   + Microsoft + Microsoft +   + Symantec + Symantec +   + Trend Micro + Trend Micro +   + IPFire + IPFire - - + +   +   + Avira + Avira +   + AVG + AVG +   + $Lang::tr{ + $Lang::tr{'updxlrtr other'} +   + +   + + END ; -} -# ------------------------------------------------------------------- -# Initialize Cache-Settings Form -# ------------------------------------------------------------------- - -sub initfrmsettings { - $checked{'ENABLE_LOG'}{'off'} = ''; - $checked{'ENABLE_LOG'}{'on'} = ''; - $checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} = "checked='checked'"; - $checked{'PASSIVE_MODE'}{'off'} = ''; - $checked{'PASSIVE_MODE'}{'on'} = ''; - $checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} = "checked='checked'"; - $checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} = ''; - $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} = ''; - $checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}} = "checked='checked'"; - $checked{'ENABLE_AUTOCHECK'}{'off'} = ''; - $checked{'ENABLE_AUTOCHECK'}{'on'} = ''; - $checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} = "checked='checked'"; - $checked{'FULL_AUTOSYNC'}{'off'} = ''; - $checked{'FULL_AUTOSYNC'}{'on'} = ''; - $checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} = "checked='checked'"; - $selected{'VIEW_SETTING'}{'overview'} = ''; - $selected{'VIEW_SETTING'}{'statistics'} = ''; - $selected{'VIEW_SETTING'}{'maintenance'} = ''; - $selected{'VIEW_SETTING'}{'settings'} = ''; - $selected{'VIEW_SETTING'}{$xlratorsettings{'VIEW_SETTING'}} = "checked='checked'"; - $selected{'AUTOCHECK_SCHEDULE'}{'daily'} = ''; - $selected{'AUTOCHECK_SCHEDULE'}{'weekly'} = ''; - $selected{'AUTOCHECK_SCHEDULE'}{'monthly'} = ''; - $selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = "selected='selected'"; } -# ------------------------------------------------------------------- -# Print Cache-Settings Form # ------------------------------------------------------------------- -sub printfrmsettings { - print < -
- $Lang::tr{'updxlrtr standard view'} - - - - - - - - -
-
- $Lang::tr{'updxlrtr common settings'} - - - - - - -
-
- $Lang::tr{'updxlrtr performance options'} - - - - -
-
- $Lang::tr{'updxlrtr source checkup'} - - - - -
- - -
-
- - -
- +sub printlegendspacer +{ + print < +  
+ END ; } -# ------------------------------------------------------------------- -# chksettings([save|restart]) - Check settings and/or restart proxy # ------------------------------------------------------------------- -sub chksettings { - my $param = shift; - my $error_ref = shift; - if ( $param =~ /save/i ) { - if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) - || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) - || ($xlratorsettings{'MAX_DISK_USAGE'} > 100)) { - push(@$error_ref, $Lang::tr{'updxlrtr invalid disk usage'}); - } - if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) - || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) { - push(@$error_ref, $Lang::tr{'updxlrtr invalid download rate'}); - } - unless (@$error_ref >= 1) { &savesettings; } - } - if ($param =~ /restart/i ) { - if ((!(-e "${General::swroot}/proxy/enable")) && (!(-e "${General::swroot}/proxy/enable_blue"))) { - push(@$error_ref, $Lang::tr{'updxlrtr web proxy service required'}); - } - if ($proxysettings{'ENABLE_UPDXLRATOR'} ne 'on') { - push(@$error_ref, $Lang::tr{'updxlrtr not enabled'}); - } - unless (@$error_ref >= 1) { system('/usr/local/bin/squidctrl restart > /dev/null 2>&1'); } - } - unless (@$error_ref == 0) { &initfrmsettings; } -} +sub savesettings +{ -# ------------------------------------------------------------------- + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily')) + { + system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); + } + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) + { + system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); + } + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) + { + system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1'); + } -sub savesettings { - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily')) - { system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) - { system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) - { system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1'); } - - # don't save those variable to the settings file, - # but we wan't to have them in the hash again after saving to file - my $obsolete = $xlratorsettings{'REMOVE_UNKNOWN'}; - my $nosource = $xlratorsettings{'REMOVE_NOSOURCE'}; - my $outdated = $xlratorsettings{'REMOVE_OUTDATED'}; - my $todelete = $xlratorsettings{'REMOVE_TODELETE'}; - my $gui = $xlratorsettings{'EXTENDED_GUI'}; - my $show = $xlratorsettings{'show'}; - - delete($xlratorsettings{'REMOVE_UNKNOWN'}); - delete($xlratorsettings{'REMOVE_NOSOURCE'}); - delete($xlratorsettings{'REMOVE_OUTDATED'}); - delete($xlratorsettings{'REMOVE_TODELETE'}); - delete($xlratorsettings{'TODELETE'}); - delete($xlratorsettings{'EXTENDED_GUI'}); - delete($xlratorsettings{'show'}); - - &General::writehash("${General::swroot}/updatexlrator/settings", \%xlratorsettings); - - # put temp variables back into the hash - $xlratorsettings{'REMOVE_UNKNOWN'} = $obsolete; - $xlratorsettings{'REMOVE_NOSOURCE'} = $nosource; - $xlratorsettings{'REMOVE_OUTDATED'} = $outdated; - $xlratorsettings{'REMOVE_TODELETE'} = $todelete; - $xlratorsettings{'EXTENDED_GUI'} = $gui; - $xlratorsettings{'show'} = $show; -} + # don't save those variable to the settings file, + # but we wan't to have them in the hash again after saving to file + my $obsolete = $xlratorsettings{'REMOVE_OBSOLETE'}; + my $nosource = $xlratorsettings{'REMOVE_NOSOURCE'}; + my $outdated = $xlratorsettings{'REMOVE_OUTDATED'}; + my $gui = $xlratorsettings{'EXTENDED_GUI'}; + delete($xlratorsettings{'REMOVE_OBSOLETE'}); + delete($xlratorsettings{'REMOVE_NOSOURCE'}); + delete($xlratorsettings{'REMOVE_OUTDATED'}); -# ------------------------------------------------------------------- -# percentbar(number[, number2, number(n)) - need absolute values -# - print relative bars ([##1][##2(number2-number1)][#n-#2-#1]...) -# ------------------------------------------------------------------- + delete($xlratorsettings{'EXTENDED_GUI'}); -sub percentbar { - $counts = '0'; - my $width = '-0'; # width of value bar - my $widthmax = '-0'; # overall width - my $tmp = ''; - my @tmplst; - my $sf = 1; # scale-factor - print "
"; - @_ = sort{ $a <=> $b } @_; - for (@_) { - unless ($widthmax <= 100.0) { next; }; - $width = $_-($widthmax); - $widthmax = $_; - if (($width > 0) && ($width < 1)) { $width=1; } - $tmp .= "
\n"; - $counts = $counts + 1; - } - $widthmax = sprintf("%0d",$widthmax); - if ( $widthmax < 79) { $tmp .= "$widthmax%\n"; } - else { $tmp .= "$widthmax%\n"; } - - print "\t\t$tmp
\n"; - return; + &General::writehash("${General::swroot}/updatexlrator/settings", \%xlratorsettings); + + # put temp variables back into the hash + $xlratorsettings{'REMOVE_OBSOLETE'} = $obsolete; + $xlratorsettings{'REMOVE_NOSOURCE'} = $nosource; + $xlratorsettings{'REMOVE_OUTDATED'} = $outdated; + $xlratorsettings{'EXTENDED_GUI'} = $gui; } # ------------------------------------------------------------------- -# Format given filesize in Bits -# into values of more human readable format like kB, MB, GB, etc -# take filesize in Bit, returns formatted string in example "xx.xx kB" -# No roundings are happened, -# so counting with the output may result in wrong values -# ------------------------------------------------------------------- -sub format_size{ - my $fsize = shift; - - if ($fsize > 2**60) # EB: 1024 PB - { return sprintf("%.2f EB", $fsize / 2**40); } - elsif ($fsize > 2**50) # PB: 1024 TB - { return sprintf("%.2f PB", $fsize / 2**40); } - elsif ($fsize > 2**40) # TB: 1024 GB - { return sprintf("%.2f TB", $fsize / 2**40); } - elsif ($fsize > 2**30) # GB: 1024 MB - { return sprintf("%.2f GB", $fsize / 2**30); } - elsif ($fsize > 2**20) # MB: 1024 kB - { return sprintf("%.2f MB", $fsize / 2**20); } - elsif ($fsize > 2**10) # kB: 1024 B - { return sprintf("%.2f KB", $fsize / 2**10); } - else # Bytes - { return "$fsize B"; } +sub percentbar +{ + my $percent = $_[0]; + my $fg = '#a0a0a0'; + my $bg = '#e2e2e2'; + + if ($percent =~ m/^(\d+)%$/ ) + { + print < + +END +; + if ($percent eq "100%") { + print "" + } elsif ($percent eq "0%") { + print "" + } else { + print "" + } + print < +END +; + } } # ------------------------------------------------------------------- sub getmtime { - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); - return $mtime; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); + + return $mtime; } # ------------------------------------------------------------------- sub getPID { - my $pid=''; - my @psdata=`ps ax --no-heading`; + my $pid=''; + my @psdata=`ps ax --no-heading`; + + foreach (@psdata) + { + if (/$_[0]/) { ($pid)=/^\s*(\d+)/; } + } - foreach (@psdata) - { if (/$_[0]/) { ($pid)=/^\s*(\d+)/; } } - return $pid; + return $pid; } # ------------------------------------------------------------------- -# Calculating Percentage of 2 Values (for percentbar) -# ------------------------------------------------------------------- - -sub cpof { - my $Value; - my $MValue; - my $result; - my $Vsize; - my $MVsize; - my $corf; - my $callme = "cpof\(value[B|K|M|G|T|P|E], maxvalue[B|K|M|G|T|P|E]\)"; - $Value = shift; - $MValue = shift; - my %cf = ('B'=>0,'K'=>1,'M'=>2,'G'=>3,'T'=>4,'P'=>5,'E'=>6); - unless ('$Value' ne '') { die "updxlrtr sub cpof: value not given: $!\n$callme"; } - unless ('$MValue' ne '') { die "updxlrtr sub cpof: maxvalue not given: $!\n$callme"; } - - unless ($Value =~ /\d+(B|K|M|G|T|P|E)/) { die "updxlrtr: cpof() - value has no size!\nPossible Values: 'number[B|K|M|G|T|P|E]'\n"; } - else { $Vsize = chop $Value; } - unless ($MValue =~ /\d+(B|K|M|G|T|P|E)/) { die "updxlrtr: cpof(): maxvalue has no size!\nPossible Values: 'number[B|K|M|G|T|P|E]'\n"; } - else { $MVsize = chop $MValue; } - - if ('$Vsize' eq '$MVsize') { $result = (100/$MValue)*$Value; } - else { - if ($Value =~ /^0\.d+/) { $corf = 1; } - else { $corf = '0'; } - } - my $tmp = (100/($MValue*(2**(10*$cf{$MVsize}))))*($Value*(2**(10*($cf{$Vsize}-$corf)))); - $tmp = sprintf ("%.2f", $tmp); - return $tmp; -} diff --git a/html/html/images/updbooster/updxl-globe.gif b/html/html/images/updbooster/updxl-globe.gif new file mode 100644 index 000000000..54e49fc82 Binary files /dev/null and b/html/html/images/updbooster/updxl-globe.gif differ diff --git a/html/html/images/updbooster/updxl-gr.gif b/html/html/images/updbooster/updxl-gr.gif new file mode 100644 index 000000000..f8b8ec07b Binary files /dev/null and b/html/html/images/updbooster/updxl-gr.gif differ diff --git a/html/html/images/updbooster/updxl-led-blue.gif b/html/html/images/updbooster/updxl-led-blue.gif new file mode 100644 index 000000000..80424c931 Binary files /dev/null and b/html/html/images/updbooster/updxl-led-blue.gif differ diff --git a/html/html/images/updbooster/updxl-led-gray.gif b/html/html/images/updbooster/updxl-led-gray.gif new file mode 100644 index 000000000..ccac733b8 Binary files /dev/null and b/html/html/images/updbooster/updxl-led-gray.gif differ diff --git a/html/html/images/updbooster/updxl-led-green.gif b/html/html/images/updbooster/updxl-led-green.gif new file mode 100644 index 000000000..f8b8ec07b Binary files /dev/null and b/html/html/images/updbooster/updxl-led-green.gif differ diff --git a/html/html/images/updbooster/updxl-led-red.gif b/html/html/images/updbooster/updxl-led-red.gif new file mode 100644 index 000000000..4bce21f24 Binary files /dev/null and b/html/html/images/updbooster/updxl-led-red.gif differ diff --git a/html/html/images/updbooster/updxl-led-yellow.gif b/html/html/images/updbooster/updxl-led-yellow.gif new file mode 100644 index 000000000..f7e4f9ab5 Binary files /dev/null and b/html/html/images/updbooster/updxl-led-yellow.gif differ diff --git a/html/html/images/updbooster/updxl-rd.gif b/html/html/images/updbooster/updxl-rd.gif new file mode 100644 index 000000000..4bce21f24 Binary files /dev/null and b/html/html/images/updbooster/updxl-rd.gif differ diff --git a/html/html/images/updbooster/updxl-src-adobe.gif b/html/html/images/updbooster/updxl-src-adobe.gif index 1152105f3..ebcd551aa 100644 Binary files a/html/html/images/updbooster/updxl-src-adobe.gif and b/html/html/images/updbooster/updxl-src-adobe.gif differ diff --git a/html/html/images/updbooster/updxl-src-ageofconan.gif b/html/html/images/updbooster/updxl-src-ageofconan.gif deleted file mode 100644 index 99b301a0a..000000000 Binary files a/html/html/images/updbooster/updxl-src-ageofconan.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-avira.gif b/html/html/images/updbooster/updxl-src-avira.gif index 86e2bb77b..1ed0d816b 100644 Binary files a/html/html/images/updbooster/updxl-src-avira.gif and b/html/html/images/updbooster/updxl-src-avira.gif differ diff --git a/html/html/images/updbooster/updxl-src-curse.gif b/html/html/images/updbooster/updxl-src-curse.gif deleted file mode 100644 index 72fab8657..000000000 Binary files a/html/html/images/updbooster/updxl-src-curse.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-diabloiii.gif b/html/html/images/updbooster/updxl-src-diabloiii.gif deleted file mode 100644 index c4f3fdf85..000000000 Binary files a/html/html/images/updbooster/updxl-src-diabloiii.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-eveonline.gif b/html/html/images/updbooster/updxl-src-eveonline.gif deleted file mode 100644 index 12f5ffa99..000000000 Binary files a/html/html/images/updbooster/updxl-src-eveonline.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-google.gif b/html/html/images/updbooster/updxl-src-google.gif deleted file mode 100644 index e62e292c7..000000000 Binary files a/html/html/images/updbooster/updxl-src-google.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-ipfire.gif b/html/html/images/updbooster/updxl-src-ipfire.gif deleted file mode 100644 index 2db127680..000000000 Binary files a/html/html/images/updbooster/updxl-src-ipfire.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-kaspersky.gif b/html/html/images/updbooster/updxl-src-kaspersky.gif index dab09a89a..687a6c3be 100644 Binary files a/html/html/images/updbooster/updxl-src-kaspersky.gif and b/html/html/images/updbooster/updxl-src-kaspersky.gif differ diff --git a/html/html/images/updbooster/updxl-src-mozilla.gif b/html/html/images/updbooster/updxl-src-mozilla.gif deleted file mode 100644 index 1d1e3d09c..000000000 Binary files a/html/html/images/updbooster/updxl-src-mozilla.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-nvidia.gif b/html/html/images/updbooster/updxl-src-nvidia.gif deleted file mode 100644 index f25c41ef8..000000000 Binary files a/html/html/images/updbooster/updxl-src-nvidia.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-opera.gif b/html/html/images/updbooster/updxl-src-opera.gif deleted file mode 100644 index 0cbf9b633..000000000 Binary files a/html/html/images/updbooster/updxl-src-opera.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-secunia.gif b/html/html/images/updbooster/updxl-src-secunia.gif deleted file mode 100644 index fc980b13f..000000000 Binary files a/html/html/images/updbooster/updxl-src-secunia.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-swtor.gif b/html/html/images/updbooster/updxl-src-swtor.gif deleted file mode 100644 index 13fe222b0..000000000 Binary files a/html/html/images/updbooster/updxl-src-swtor.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-wot.gif b/html/html/images/updbooster/updxl-src-wot.gif deleted file mode 100644 index e76f48cc2..000000000 Binary files a/html/html/images/updbooster/updxl-src-wot.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-wow.gif b/html/html/images/updbooster/updxl-src-wow.gif deleted file mode 100644 index e64432e8d..000000000 Binary files a/html/html/images/updbooster/updxl-src-wow.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-yl.gif b/html/html/images/updbooster/updxl-yl.gif new file mode 100644 index 000000000..f7e4f9ab5 Binary files /dev/null and b/html/html/images/updbooster/updxl-yl.gif differ diff --git a/html/html/themes/ipfire/images/updxl-icons.gif b/html/html/themes/ipfire/images/updxl-icons.gif deleted file mode 100644 index bae5cb663..000000000 Binary files a/html/html/themes/ipfire/images/updxl-icons.gif and /dev/null differ diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 086ff183e..c557e8b17 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -161,7 +161,6 @@ END print < - $extrahead + - -
-
-
-
+ + + +
+
+
+
END ; } @@ -334,10 +340,12 @@ sub closepage () { $uptime =~ s/load average/$Lang::tr{'uptime load average'}/; print < -
-
-
+
+
+ +
+ +
END ; &showsubsection($menu); @@ -353,16 +361,17 @@ END ; if ($settings{'SPEED'} ne 'off') { print < - $Lang::tr{'bandwidth usage'}: +
+ $Lang::tr{'bandwidth usage'}: $Lang::tr{'incoming'}:  $Lang::tr{'outgoing'}: + END ; } print < -
-
+
+
+
END @@ -379,25 +388,25 @@ sub closebigbox sub openbox { - $width = $_[0]; - $align = $_[1]; - $caption = $_[2]; + $width = $_[0]; + $align = $_[1]; + $caption = $_[2]; - print < -
+
END ; - if ($caption) { print "

$caption

\n"; } else { print " "; } + if ($caption) { print "

$caption

\n"; } else { print " "; } } sub closebox { - print < -
- + print < +
+ END ; } diff --git a/html/html/themes/ipfire/include/upxlr.css b/html/html/themes/ipfire/include/upxlr.css deleted file mode 100644 index e7cc9fd92..000000000 --- a/html/html/themes/ipfire/include/upxlr.css +++ /dev/null @@ -1,384 +0,0 @@ -span[id^=ledgr],li#liledgr,label#lbledgr -{ - background-position:0 0; -} - -span[id^=ledbl],li#liledbl,label#lbledbl -{ - background-position:0 -20px; -} - -span[id^=ledye],li#liledye,label#lbledye -{ - background-position:0 -40px; -} - -span[id^=ledrd],li#liledrd,label#lbledrd -{ - background-position:0 -60px; -} - -span[id^=ledgy],li#liledgy,label#lbledgy -{ - background-position:0 -80px; -} - -span#rel,li#lirel -{ - background-position:0 -100px; -} - -span#glo,li#liglo -{ - background-position:0 -120px; -} - -span#del,li#lidel,label#lbdel,button[id^=del] -{ - background-position:0 -140px; -} - -span#blo,li#liblo -{ - background-position:0 -160px; -} - -#stat -{ - background-position:0 -180px; -} - -#wrench -{ - background-position:0 -200px; -} - -#set -{ - background-position:0 -220px; -} - -#oview -{ - background-position:0 -240px; -} - -.symbols -{ - background:transparent url(/themes/ipfire/images/updxl-icons.gif) no-repeat; - height:20px; - width:20px; -} - -.vendimg -{ - background-repeat:no-repeat; - height:18px; - width:18px; -} - -.noborder -{ - border:none; -} - -fieldset -{ - padding: 0 0 .5em; - margin-bottom: .5em; - border: 1px dotted #E1E1E1; - border-top: none; - border-left: none; - border-right: none; -} - -legend -{ - margin-left:0; - padding-left:0; - padding-right:.5em; - font-weight: bolder; -} - -label -{ - cursor:pointer; - padding-right:1em; -} - -label[for^=text],label[for^=select] -{ - padding-right:.2em; -} - -label.symbols -{ - display:inline-block; - min-height:20px; - padding-left:25px; - width:auto; -} - -button[id^=del] -{ - border-style:none; -} - -input:invalid -{ - border:2px solid red; -} - -input#text01 -{ - height:1em; - max-width:120px; -} - -input#text02 -{ - width:7em; -} - -input[type=submit] { - margin-right: 3em; - margin-left: 3em; -} - -output#duval -{ - display:inline-block; - min-width:2em; - text-align:right; -} - -.frmshow -{ - position:absolute; - right:0; - top:0; -} - -.frmshow fieldset -{ - display:inline-block; - position:relative; -} - -.frmshow legend -{ - display:inline-block; -} - -.frmshow legend span -{ - left:-100px; - position:absolute; - top:.2em; -} - -.frmshow button -{ - border:1px solid; - display:inline; - height:22px; - padding-left:25px; - padding-right:5px; - width:auto; - cursor: pointer; -} - -.frmshow button:disabled -{ - border:1px solid #D90000; - color:#D90000; - cursor: default; -} - -span.symbols,span.vendimg -{ - display:inline-block; -} - -caption -{ - margin-top:.5em; - font-weight:bolder; -} - -table -{ - width:100%; -} - -#diskusage td -{ - text-align:center; -} - -#summary -{ - background-color:none!important; -} - -[id^=list] thead tr th -{ - border-bottom:1px dotted #E1E1E1; -} - -th -{ - text-align:center; -} - -td,th -{ - padding:3px; -} - -tbody tr:nth-child(even) -{ - background:#D6D6D6; -} - -tbody tr:nth-child(odd) -{ - background:#F0F0F0; -} - -th span.symbols,th span.vendimg -{ - vertical-align:middle!important; -} - -th span[id^=vd].vendimg -{ - display:block; - padding-left:27px; - text-align:left!important; - width:auto; -} - -tbody tr td -{ - text-align:right; -} - -tfoot tr td -{ - border-top:1px dotted #E1E1E1; -} - -tfoot ul -{ - list-style-type:none; - margin-left:1em; - padding-left:0; -} - -li.symbols -{ - padding-left:23px; -} - -li.vendimg -{ - padding-left:25px; -} - -tfoot ul li -{ - background-repeat:no-repeat; - display:inline; - margin-bottom:.3em; - padding-right:1em; -} - -li.symbols,li.vendimg -{ - display:inline-block; - width:auto; -} - -td[id^=legend] h5 -{ - font-size:.9em; -} - -div#pbar -{ - background-color:#90EE90; - border:1px solid #a0a0a0; - height:15px; - min-width:100px; - padding-right:2px; - position:relative; - text-align:left; - width:auto; -} - -div[id^=bar] -{ - background-color:red; - border:1px solid #e2e2e2; - border-left:none; - border-right:none; - float:left; - height:13px; -} - -div#bar1 -{ - background-color:orange; -} - -div#bar2 -{ - background-color:blue; -} - -div#bar3 -{ - background-color:#FF0; -} - -span#duused -{ - color: red; - font-weight: bolder; -} - -span#free -{ - color: green; - font-weight: bolder; -} - -span#percent -{ - font-weight:bolder; - position:relative; -} - -span#max -{ - position:absolute; - right:2px; -} - -span#used -{ - color: orange; - font-weight: bolder; -} - -hr -{ - margin-bottom:1em; -} - -#errors -{ - color:#CA2F2F; - font-weight:bolder; -} \ No newline at end of file diff --git a/html/html/themes/maniac/images/Thumbs.db b/html/html/themes/maniac/images/Thumbs.db new file mode 100644 index 000000000..37ec790fd Binary files /dev/null and b/html/html/themes/maniac/images/Thumbs.db differ diff --git a/html/html/themes/maniac/images/updxl-icons.gif b/html/html/themes/maniac/images/updxl-icons.gif deleted file mode 100644 index bae5cb663..000000000 Binary files a/html/html/themes/maniac/images/updxl-icons.gif and /dev/null differ diff --git a/html/html/themes/maniac/include/functions.pl b/html/html/themes/maniac/include/functions.pl index e072d3bc8..eea8091b0 100644 --- a/html/html/themes/maniac/include/functions.pl +++ b/html/html/themes/maniac/include/functions.pl @@ -147,7 +147,8 @@ sub openpage { - $title + $title + $extrahead END ; if ($settings{'FX'} ne 'off') { @@ -160,84 +161,87 @@ END print < - $extrahead + END ; if ($settings{'SPEED'} ne 'off') { print < - + - - + + + END ; } else { - print "\n";} +print "\n";} print < -