From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 5d73f5158c1903ac9bbd697e956083ae5c986238 Date: Mon, 29 Apr 2013 13:14:57 +0200 Message-ID: <20130429111459.9EB8720135@argus.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1115932782317878585==" List-Id: --===============1115932782317878585== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 5d73f5158c1903ac9bbd697e956083ae5c986238 (commit) via 5cf2c339680b6922a08ebf1d44dab5c90ba2d5d4 (commit) via b376fae45ca8a9b5250a974b2b5247c854ed2782 (commit) from 910209a1e506e2ca70083ba02d3fd2bf1f8fbbc2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5d73f5158c1903ac9bbd697e956083ae5c986238 Merge: 5cf2c33 b376fae Author: Michael Tremer Date: Mon Apr 29 13:14:46 2013 +0200 Merge remote-tracking branch 'amarx/10352' into next commit 5cf2c339680b6922a08ebf1d44dab5c90ba2d5d4 Author: Michael Tremer Date: Mon Apr 29 13:13:07 2013 +0200 Update accelerator changes from J=C3=B6rn-Ingo Weigert. =20 Conflicts: config/rootfiles/core/68/filelists/files commit b376fae45ca8a9b5250a974b2b5247c854ed2782 Author: Alexander Marx Date: Mon Apr 29 12:57:01 2013 +0200 OpenVPN: Bugfix 10352: When opening advanced server options all fields ar= e disabled under IE10 ----------------------------------------------------------------------- Summary of changes: config/rootfiles/core/68/filelists/files | 30 + html/cgi-bin/ovpnmain.cgi | 2 +- html/cgi-bin/updatexlrator.cgi | 2425 +++++++++---------= -- html/html/images/updbooster/updxl-globe.gif | Bin 1124 -> 0 bytes html/html/images/updbooster/updxl-gr.gif | Bin 898 -> 0 bytes html/html/images/updbooster/updxl-led-blue.gif | Bin 158 -> 0 bytes html/html/images/updbooster/updxl-led-gray.gif | Bin 158 -> 0 bytes html/html/images/updbooster/updxl-led-green.gif | Bin 898 -> 0 bytes html/html/images/updbooster/updxl-led-red.gif | Bin 898 -> 0 bytes html/html/images/updbooster/updxl-led-yellow.gif | Bin 158 -> 0 bytes html/html/images/updbooster/updxl-rd.gif | Bin 898 -> 0 bytes html/html/images/updbooster/updxl-src-adobe.gif | Bin 1000 -> 1135 bytes .../images/updbooster/updxl-src-ageofconan.gif | Bin 0 -> 1171 bytes html/html/images/updbooster/updxl-src-avira.gif | Bin 1045 -> 1127 bytes html/html/images/updbooster/updxl-src-curse.gif | Bin 0 -> 1090 bytes .../html/images/updbooster/updxl-src-diabloiii.gif | Bin 0 -> 979 bytes .../html/images/updbooster/updxl-src-eveonline.gif | Bin 0 -> 411 bytes html/html/images/updbooster/updxl-src-google.gif | Bin 0 -> 586 bytes html/html/images/updbooster/updxl-src-ipfire.gif | Bin 0 -> 1036 bytes .../html/images/updbooster/updxl-src-kaspersky.gif | Bin 996 -> 628 bytes html/html/images/updbooster/updxl-src-mozilla.gif | Bin 0 -> 1092 bytes html/html/images/updbooster/updxl-src-nvidia.gif | Bin 0 -> 1000 bytes html/html/images/updbooster/updxl-src-opera.gif | Bin 0 -> 1016 bytes html/html/images/updbooster/updxl-src-secunia.gif | Bin 0 -> 316 bytes html/html/images/updbooster/updxl-src-swtor.gif | Bin 0 -> 1101 bytes html/html/images/updbooster/updxl-src-wot.gif | Bin 0 -> 114 bytes html/html/images/updbooster/updxl-src-wow.gif | Bin 0 -> 1111 bytes html/html/images/updbooster/updxl-yl.gif | Bin 158 -> 0 bytes html/html/themes/ipfire/images/updxl-icons.gif | Bin 0 -> 2358 bytes html/html/themes/ipfire/include/functions.pl | 122 +- html/html/themes/ipfire/include/upxlr.css | 384 ++++ html/html/themes/maniac/images/Thumbs.db | Bin 13312 -> 0 bytes html/html/themes/maniac/images/updxl-icons.gif | Bin 0 -> 2358 bytes html/html/themes/maniac/include/functions.pl | 214 +- html/html/themes/maniac/include/upxlr.css | 390 ++++ langs/de/cgi-bin/de.pl | 23 +- langs/en/cgi-bin/en.pl | 22 +- 37 files changed, 2132 insertions(+), 1480 deletions(-) delete mode 100644 html/html/images/updbooster/updxl-globe.gif delete mode 100644 html/html/images/updbooster/updxl-gr.gif delete mode 100644 html/html/images/updbooster/updxl-led-blue.gif delete mode 100644 html/html/images/updbooster/updxl-led-gray.gif delete mode 100644 html/html/images/updbooster/updxl-led-green.gif delete mode 100644 html/html/images/updbooster/updxl-led-red.gif delete mode 100644 html/html/images/updbooster/updxl-led-yellow.gif delete mode 100644 html/html/images/updbooster/updxl-rd.gif create mode 100644 html/html/images/updbooster/updxl-src-ageofconan.gif create mode 100644 html/html/images/updbooster/updxl-src-curse.gif create mode 100644 html/html/images/updbooster/updxl-src-diabloiii.gif create mode 100644 html/html/images/updbooster/updxl-src-eveonline.gif create mode 100644 html/html/images/updbooster/updxl-src-google.gif create mode 100644 html/html/images/updbooster/updxl-src-ipfire.gif create mode 100644 html/html/images/updbooster/updxl-src-mozilla.gif create mode 100644 html/html/images/updbooster/updxl-src-nvidia.gif create mode 100644 html/html/images/updbooster/updxl-src-opera.gif create mode 100644 html/html/images/updbooster/updxl-src-secunia.gif create mode 100644 html/html/images/updbooster/updxl-src-swtor.gif create mode 100644 html/html/images/updbooster/updxl-src-wot.gif create mode 100644 html/html/images/updbooster/updxl-src-wow.gif delete mode 100644 html/html/images/updbooster/updxl-yl.gif create mode 100644 html/html/themes/ipfire/images/updxl-icons.gif create mode 100644 html/html/themes/ipfire/include/upxlr.css delete mode 100644 html/html/themes/maniac/images/Thumbs.db create mode 100644 html/html/themes/maniac/images/updxl-icons.gif create mode 100644 html/html/themes/maniac/include/upxlr.css Difference in files: diff --git a/config/rootfiles/core/68/filelists/files b/config/rootfiles/core= /68/filelists/files index bfd6746..46ea0b8 100644 --- a/config/rootfiles/core/68/filelists/files +++ b/config/rootfiles/core/68/filelists/files @@ -4,9 +4,39 @@ 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/local/bin/consort.sh var/ipfire/backup/include diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 1cfade6..a4953ff 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -2375,7 +2375,7 @@ ADV_ERROR: } &Header::openbox('100%', 'LEFT', $Lang::tr{'advanced server'}); print < +
diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index df77a86..42362c2 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -36,8 +36,8 @@ use strict; =20 # 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'; =20 use IO::Socket; =20 @@ -45,7 +45,6 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; =20 -my %color =3D (); my %checked=3D(); my %selected=3D(); my %netsettings=3D(); @@ -56,6 +55,8 @@ my %dlinfo=3D(); my $id=3D0; my @dfdata=3D(); my $dfstr=3D''; +my $dudata=3D''; +my $dustr=3D''; my @updatelist=3D(); my @sources=3D(); my $sourceurl=3D''; @@ -63,6 +64,7 @@ my $vendorid=3D''; my $uuid=3D''; my $status=3D0; my $updatefile=3D''; +my $cachefile=3D''; my $shortname=3D''; my $time=3D''; my $filesize=3D0; @@ -78,11 +80,11 @@ my $cachehits=3D0; my $efficiency=3D'0.0'; my @vendors=3D(); my %vendorstats=3D(); +my %vendimg =3D (); =20 -my $repository =3D "/var/updatecache/"; -my $webhome =3D "/srv/web/ipfire/html";=20 -my $hintcolour =3D '#FFFFCC'; -my $colourgray =3D '#808080'; +my $repository =3D '/var/updatecache/'; +my $webhome =3D '/srv/web/ipfire/html'; +my $webimgdir =3D '/images/updbooster'; =20 my $sfUnknown=3D'0'; my $sfOk=3D'1'; @@ -91,7 +93,7 @@ my $sfNoSource=3D'3'; =20 my $not_accessed_last=3D''; =20 -my $errormessage=3D''; +my @errormessages=3D(); =20 my @repositorylist=3D(); my @repositoryfiles=3D(); @@ -103,7 +105,6 @@ my @metadata=3D(); &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'}."/i= nclude/colors.txt", \%color); =20 $xlratorsettings{'ACTION'} =3D ''; $xlratorsettings{'ENABLE_LOG'} =3D 'off'; @@ -116,1451 +117,1305 @@ $xlratorsettings{'FULL_AUTOSYNC'} =3D 'off'; $xlratorsettings{'NOT_ACCESSED_LAST'} =3D 'month1'; $xlratorsettings{'REMOVE_NOSOURCE'} =3D 'off'; $xlratorsettings{'REMOVE_OUTDATED'} =3D 'off'; -$xlratorsettings{'REMOVE_OBSOLETE'} =3D 'off'; +$xlratorsettings{'REMOVE_UNKNOWN'} =3D 'off'; +$xlratorsettings{'REMOVE_TODELETE'} =3D 'off'; +$xlratorsettings{'TODELETE'} =3D 'off'; +$xlratorsettings{'show'} =3D ''; =20 &Header::getcgihash(\%xlratorsettings); =20 -$xlratorsettings{'EXTENDED_GUI'} =3D ''; - -if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>") -{ - $xlratorsettings{'EXTENDED_GUI'} =3D 'statistics'; -} - -if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>") -{ - $xlratorsettings{'EXTENDED_GUI'} =3D 'maintenance'; -} - -if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr purge'}) -{ - $xlratorsettings{'EXTENDED_GUI'} =3D 'maintenance'; - - if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REM= OVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on')) - { - undef (@sources); - undef @repositoryfiles; - foreach (<$repository/*>) - { - if (-d $_) - { - unless (/^$repository\/download$/) { push(@sources,$_); } - } - } - - foreach (@sources) - { - @updatelist=3D<$_/*>; - $vendorid =3D substr($_,rindex($_,"/")+1); - foreach(@updatelist) - { - $uuid =3D substr($_,rindex($_,"/")+1); - if (-e "$_/source.url") - { - open (FILE,"$_/source.url"); - $sourceurl=3D; - close FILE; - chomp($sourceurl); - $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($sour= ceurl)); - $updatefile =3D "$vendorid/$uuid/$updatefile"; - push(@repositoryfiles,$updatefile); - } - } - } - - foreach (@repositoryfiles) - { - ($vendorid,$uuid,$updatefile) =3D split('/'); - - if (-e "$repository/$vendorid/$uuid/status") - { - open (FILE,"$repository/$vendorid/$uuid/status"); - @metadata =3D ; - close FILE; - chomp(@metadata); - $status =3D $metadata[-1]; - } - - if (-e "$repository/$vendorid/$uuid/access.log") - { - open (FILE,"$repository/$vendorid/$uuid/access.log"); - @metadata =3D ; - close FILE; - chomp(@metadata); - $lastaccess =3D $metadata[-1]; - } - - if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status =3D=3D $sfN= oSource)) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repos= itory/$vendorid/$uuid"); } - } - if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status =3D=3D $sfO= utdated)) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repos= itory/$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 $repo= sitory/$vendorid/$uuid"); } - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess = < (time - 2505600))) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repo= sitory/$vendorid/$uuid"); } - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess = < (time - 7516800))) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repo= sitory/$vendorid/$uuid"); } - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess = < (time - 15033600))) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repo= sitory/$vendorid/$uuid"); } - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < = (time - 31536000))) - { - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repo= sitory/$vendorid/$uuid"); } - } - } - } - } -} +# ------------------------------------------------------ +# Check if some ACTION is required +# ------------------------------------------------------ =20 if ($xlratorsettings{'ACTION'} eq $Lang::tr{'save'}) -{ - if (!($xlratorsettings{'MAX_DISK_USAGE'} =3D~ /^\d+$/) || ($xlratorsettings= {'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100)) - { - $errormessage =3D $Lang::tr{'updxlrtr invalid disk usage'}; - goto ERROR; - } - if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'= MAX_DOWNLOAD_RATE'} =3D~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} = < 1))) - { - $errormessage =3D $Lang::tr{'updxlrtr invalid download rate'}; - goto ERROR; - } - - &savesettings; -} + { &chksettings('save',\@errormessages); + $xlratorsettings{'show'} =3D 'settings'; + } +elsif ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) + { &chksettings('saverestart',\@errormessages); + $xlratorsettings{'show'} =3D 'settings'; + } +elsif ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr cancel download'}) + { &canceldownload($xlratorsettings{'ID'}); + $xlratorsettings{'show'} =3D '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'} =3D 'maintenance'; + } =20 -if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) -{ - if (!($xlratorsettings{'MAX_DISK_USAGE'} =3D~ /^\d+$/) || ($xlratorsettings= {'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100)) - { - $errormessage =3D $Lang::tr{'updxlrtr invalid disk usage'}; - goto ERROR; - } - if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'= MAX_DOWNLOAD_RATE'} =3D~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} = < 1))) - { - $errormessage =3D $Lang::tr{'updxlrtr invalid download rate'}; - goto ERROR; - } - if ((!(-e "${General::swroot}/proxy/enable")) && (!(-e "${General::swroot}/= proxy/enable_blue"))) - { - $errormessage =3D $Lang::tr{'updxlrtr web proxy service required'}; - goto ERROR; - } - if (!($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on')) - { - $errormessage =3D $Lang::tr{'updxlrtr not enabled'}; - goto ERROR; - } +# ------------------------------------------------------ +# ACTION Check - End +# ------------------------------------------------------ =20 - &savesettings; +$not_accessed_last =3D $xlratorsettings{'NOT_ACCESSED_LAST'}; +undef($xlratorsettings{'NOT_ACCESSED_LAST'}); =20 - system('/usr/local/bin/squidctrl restart >/dev/null 2>&1'); +if (-e "${General::swroot}/updatexlrator/settings") { + &General::readhash("${General::swroot}/updatexlrator/settings", \%xlrators= ettings); } =20 -if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'}) -{ - $xlratorsettings{'EXTENDED_GUI'} =3D 'maintenance'; +if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '') { $xlratorsettings{'NOT_ACC= ESSED_LAST'} =3D $not_accessed_last; } =20 - $updatefile =3D $xlratorsettings{'ID'}; +if ($xlratorsettings{'show'} eq 'overview') { $xlratorsettings{'EXTENDED_GUI= '} =3D 'overview'; } +elsif ($xlratorsettings{'show'} eq 'statistics') { $xlratorsettings{'EXTENDE= D_GUI'} =3D 'statistics'; } +elsif ($xlratorsettings{'show'} eq 'settings') { $xlratorsettings{'EXTENDED_= GUI'} =3D 'settings'; } +elsif ($xlratorsettings{'show'} eq 'maintenance') { $xlratorsettings{'EXTEND= ED_GUI'} =3D 'maintenance'; } +else { $xlratorsettings{'EXTENDED_GUI'} =3D $xlratorsettings{'VIEW_SETTING'}= ?$xlratorsettings{'VIEW_SETTING'}:'overview'; } =20 - unless ($updatefile =3D~ /^download\//) - { - ($vendorid,$uuid,$updatefile) =3D split('/',$updatefile); - if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $reposit= ory/$vendorid/$uuid"); } - } -} +&initvendimg; =20 -if (($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr cancel download'}) ||= ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'})) -{ - $updatefile =3D $xlratorsettings{'ID'}; - - if ($updatefile =3D~ /^download\//) - { - ($uuid,$vendorid,$updatefile) =3D split('/',$updatefile); +# ---------------------------------------------------- +# Start Page Output +# ---------------------------------------------------- =20 - if (-e "$repository/download/$vendorid/$updatefile.info") - { - &General::readhash("$repository/download/$vendorid/$updatefile.info", \%d= linfo); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, '' ); +&Header::openbigbox('100%', 'left', '', scalar(@errormessages)); =20 - $id =3D &getPID("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s= ".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$"); - if ($id) { system("/bin/kill -9 $id"); } - $id =3D &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."= \$"); - if ($id) { system("/bin/kill -9 $id"); } +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +# CACHE OVERVIEW +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 - system("rm $repository/download/$vendorid/$updatefile.info"); - } +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(); + } =20 - if (-e "$repository/download/$vendorid/$updatefile") - { - system("rm $repository/download/$vendorid/$updatefile"); - } - } +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +# CACHE STATISTICS +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -} +if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') { + &Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}"); + &printfrmview(); + &printerrormsgs(\@errormessages); + &initcachestats(); + &printcachestatistics(); + &Header::closebox(); + }=20 =20 -$not_accessed_last =3D $xlratorsettings{'NOT_ACCESSED_LAST'}; -undef($xlratorsettings{'NOT_ACCESSED_LAST'}); +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +# CACHE MAINTENANCE +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -if (-e "${General::swroot}/updatexlrator/settings") -{ - &General::readhash("${General::swroot}/updatexlrator/settings", \%xlratorse= ttings); -} +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(); + } =20 -if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '') -{ - $xlratorsettings{'NOT_ACCESSED_LAST'} =3D $not_accessed_last; -} +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +# CACHE SETTINGS +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -ERROR: - -$checked{'ENABLE_LOG'}{'off'} =3D ''; -$checked{'ENABLE_LOG'}{'on'} =3D ''; -$checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} =3D "checked=3D'check= ed'"; -$checked{'PASSIVE_MODE'}{'off'} =3D ''; -$checked{'PASSIVE_MODE'}{'on'} =3D ''; -$checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} =3D "checked=3D'c= hecked'"; -$checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} =3D ''; -$checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} =3D ''; -$checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}}= =3D "checked=3D'checked'"; -$checked{'ENABLE_AUTOCHECK'}{'off'} =3D ''; -$checked{'ENABLE_AUTOCHECK'}{'on'} =3D ''; -$checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} =3D "chec= ked=3D'checked'"; -$checked{'FULL_AUTOSYNC'}{'off'} =3D ''; -$checked{'FULL_AUTOSYNC'}{'on'} =3D ''; -$checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} =3D "checked=3D= 'checked'"; -$checked{'REMOVE_NOSOURCE'}{'off'} =3D ''; -$checked{'REMOVE_NOSOURCE'}{'on'} =3D ''; -$checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} =3D "checke= d=3D'checked'"; -$checked{'REMOVE_OUTDATED'}{'off'} =3D ''; -$checked{'REMOVE_OUTDATED'}{'on'} =3D ''; -$checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} =3D "checke= d=3D'checked'"; -$checked{'REMOVE_OBSOLETE'}{'off'} =3D ''; -$checked{'REMOVE_OBSOLETE'}{'on'} =3D ''; -$checked{'REMOVE_OBSOLETE'}{$xlratorsettings{'REMOVE_OBSOLETE'}} =3D "checke= d=3D'checked'"; - - -$selected{'AUTOCHECK_SCHEDULE'}{'daily'} =3D ''; -$selected{'AUTOCHECK_SCHEDULE'}{'weekly'} =3D ''; -$selected{'AUTOCHECK_SCHEDULE'}{'monthly'} =3D ''; -$selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} =3D = "selected=3D'selected'"; - -$selected{'NOT_ACCESSED_LAST'}{'week'} =3D ''; -$selected{'NOT_ACCESSED_LAST'}{'month1'} =3D ''; -$selected{'NOT_ACCESSED_LAST'}{'month3'} =3D ''; -$selected{'NOT_ACCESSED_LAST'}{'month6'} =3D ''; -$selected{'NOT_ACCESSED_LAST'}{'year'} =3D ''; -$selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} =3D "s= elected=3D'selected'"; +if ($xlratorsettings{'EXTENDED_GUI'} eq 'settings') { + &Header::openbox('100%', 'left', $Lang::tr{'updxlrtr cache settings'}); + &printfrmview(); + &printerrormsgs(\@errormessages); + &initfrmsettings(); + &printfrmsettings(); + &Header::closebox(); + } =20 # ---------------------------------------------------- -# Settings dialog +# End Page Output # ---------------------------------------------------- +&Header::closebigbox(); +&Header::closepage(); =20 -&Header::showhttpheaders(); - -&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 Form to switch view +# ------------------------------------------------------------------- =20 -print < - - - - - - - - - - - - - - - -
$Lang::tr{'dhcp-options'}
$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'}:&n= bsp;3D'*' -
-
- - - - - - - - - - - - - - - -
$Lang::tr{'updxlrtr source checkup'}
$Lang::tr{'updxlrtr enable autocheck'}: - $Lang::tr{'updxlrtr source checkup schedul= e'}: - -
$Lang::tr{'updxlrtr full autosync'}:  
-
- - - - - +sub printfrmview { + print < +
+$Lang::tr{'updxlrtr current view'}: END ; - -print"
\n"; - -print" \n"; - -print < -
 >' "; } -print "/>>' "; } -print "/>
+ if ($xlratorsettings{'EXTENDED_GUI'} eq 'overview') + { print "\n"; } + else + { print "\n"; } + =20 + if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') + { print "\n"; } + else + { print "\n"; } + =20 + if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') + { print "\n"; } + else + { print "\n"; } + =20 + if ($xlratorsettings{'EXTENDED_GUI'} eq 'settings') + { print "\n"; } + else + { print "\n"; } + print < + END ; + return; +} =20 -&Header::closebox(); - -print "\n"; - -# ---------------------------------------------------- -# List pending downloads - if any -# ---------------------------------------------------- - -if (($xlratorsettings{'EXTENDED_GUI'} ne 'statistics') && ($xlratorsettings{= 'EXTENDED_GUI'} ne 'maintenance')) -{ - @downloadlist =3D <$repository/download/*>; - - undef(@downloadfiles); - foreach (@downloadlist) - { - if (-d) - { - my @filelist =3D <$_/*>; - $vendorid =3D substr($_,rindex($_,"/")+1); - foreach(@filelist) - { - next if(/\.info$/); - $updatefile =3D substr($_,rindex($_,"/")+1); - $updatefile .=3D ":download/$vendorid/$updatefile"; - $updatefile =3D " ".$updatefile; - push(@downloadfiles, $updatefile); - } - } - } - - if (@downloadfiles) - { - &Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr pending downloads'}"= ); +# ------------------------------------------------------------------- +# Print Error Messages - printerrormsgs(\@errormsgs) +# ------------------------------------------------------------------- =20 +sub printerrormsgs { + my $errmsgs_ref =3D shift; + unless (@$errmsgs_ref =3D=3D 0) { + &Header::openbox('100%', 'left', ''); print < - $Lang::tr{'updxlrtr current downloads'} - - - - - - - - - - - - +
$Lang::tr{'error messages'}
END ; - $id =3D 0; - foreach $updatefile (@downloadfiles) - { - $updatefile =3D~ s/.*://; - my $size_updatefile =3D 0; - my $mtime =3D 0; - if(-e "$repository/$updatefile") { - $size_updatefile =3D (-s "$repository/$updatefile"); - $mtime =3D &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 =3D $size_updatefile; - 1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - - my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($mtime); - $DAYdt =3D sprintf ("%.02d",$DAYdt); - $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); - $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); - $filedate =3D $YEARdt."-".$MONTHdt."-".$DAYdt; - - ($uuid,$vendorid,$shortname) =3D split('/',$updatefile); - - print "\t\t\n"; - } else { - print "3D'$Lang::t= \n"; - } - - print "\t\t\n"; - } else { - print "3D'" \n"; - } +# ------------------------------------------------------------------- +# Initialize Downloaddata +# ------------------------------------------------------------------- =20 - $shortname =3D substr($updatefile,rindex($updatefile,"/")+1); - $shortname =3D~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; +sub initdownloaddata { + @downloadlist =3D <$repository/download/*>; + my $updfile; + my $dlfiles_ref =3D shift; + undef(@$dlfiles_ref); + foreach (@downloadlist) { + if (-d) { + my @filelist =3D <$_/*>; + $vendorid =3D substr($_,rindex($_,"/")+1); + foreach(@filelist) { + next if(/\.info$/); + $updfile =3D substr($_,rindex($_,"/")+1); + $updfile .=3D ":download/$vendorid/$updfile"; + $updfile =3D " ".$updfile; + push(@$dlfiles_ref, $updfile); + } + } + } +} =20 - $filesize =3D $dlinfo{'REMOTESIZE'}; - 1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - $dlinfo{'VENDORID'} =3D ucfirst $vendorid; +# ------------------------------------------------------------------- +# Print pending Downloadlist +# ------------------------------------------------------------------- =20 - print < $dlinfo{'VENDORID'}  - - - + + + + + + + + + + + + + + + + +END +; + &printtbldldata($dllist_ref); + print < +
 $Lang::tr{'updxlrtr sour= ce'}$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 "3D'$Lang::t=  "; + foreach (@$errmsgs_ref) { print "$_
"; } + undef(@$errmsgs_ref); =20 + print "\t\t\t\n"; + &Header::closebox(); + } +} =20 - if (($vendorid ne '') && (-e "$webhome/images/updbooster/updxl-src-$vendor= id.gif")) - { - print " 
$shortname<= /td> -  $filesize = ; $filedate = ; +sub printtbldownloads { + my $dllist_ref =3D shift; + print < +
$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'} 
END ; - my $percent=3D"0%"; - if ($dlinfo{'REMOTESIZE'} && $size_updatefile) - { - $percent=3Dint(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile))."%"; - } - print $percent; &percentbar($percent); - print < - -
- - - -
+ &printlegenddownload(); + print <
END ; - } - - print "\n
\n\n"; - &printlegenddownload(); - print "
\n"; - - &Header::closebox(); - } } -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -# CACHE STATISTICS -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') -{ - -# ---------------------------------------------------- -# Get statistics -# ---------------------------------------------------- +# ------------------------------------------------------------------- +# Print Download Files - printdlfiles(\@dlfiles) +# ------------------------------------------------------------------- =20 -(a)sources=3D(); -foreach (<$repository/*>) -{ - if (-d $_) - { - unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/)) { p= ush(@sources,$_); } - } +sub printtbldldata { + my $dlfiles_ref =3D shift; + unless (@$dlfiles_ref) + { print "\n".$Lang::tr{'updxlrtr no pending down= loads attime'}."\n\n"; } + else { + $id =3D 0; + foreach $updatefile (@$dlfiles_ref) { + print "\n"; + $updatefile =3D~ s/.*://; + my $size_updatefile =3D 0; + my $mtime =3D 0; + + if(-e "$repository/$updatefile") { + $size_updatefile =3D (-s "$repository/$updatefile"); + $mtime =3D &getmtime("$repository/$updatefile"); + } + + if (-e "$repository/$updatefile.info") { &General::readhash("$reposito= ry/$updatefile.info", \%dlinfo); } + else { undef(%dlinfo); } + + $filesize =3D $size_updatefile; + 1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; + my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($mtim= e); + my $percent =3D '0'; + $DAYdt =3D sprintf ("%.02d",$DAYdt); + $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); + $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); + $filedate =3D $DAYdt.".".$MONTHdt.".".$YEARdt; + ($uuid,$vendorid,$shortname) =3D split('/',$updatefile); + $shortname =3D substr($updatefile,rindex($updatefile,"/")+1); + $shortname =3D~ s/(.*)_([\da-f]{8})*(\.(exe|cab|psf|msu)$)/$1_$2*$3/i; + unless (length($shortname) <=3D 50) { + my $fext =3D substr($shortname,rindex("$shortname",'.')); + $shortname =3D substr($shortname,0,44-length($fext)); + $shortname .=3D "[...] $fext"; + } + $filesize =3D $dlinfo{'REMOTESIZE'}; + 1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; + $dlinfo{'VENDORID'} =3D ucfirst $vendorid; + if ($dlinfo{'REMOTESIZE'} && $size_updatefile) { $percent =3D 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 ''.uc= first $dlinfo{'VENDORID'}."\n"; } + else { print ''.= ucfirst $dlinfo{'VENDORID'}."\n"; } + print <$shortname +$filesize +$filedate + +END +; + &percentbar($percent); + print < + +
+
+ + + +
+
+ + +END +; + $id +=3D 1; + } + } } =20 -(a)vendors=3D(); -foreach (@sources) -{ - $vendorid=3Dsubstr($_,rindex($_,'/')+1,length($_)); - push(@vendors,$vendorid); - $vendorstats{$vendorid."_filesize"} =3D 0; - $vendorstats{$vendorid."_requests"} =3D 0; - $vendorstats{$vendorid."_files"} =3D 0; - $vendorstats{$vendorid."_cachehits"} =3D 0; - $vendorstats{$vendorid."_0"} =3D 0; - $vendorstats{$vendorid."_1"} =3D 0; - $vendorstats{$vendorid."_2"} =3D 0; - $vendorstats{$vendorid."_3"} =3D 0; - @updatelist=3D<$_/*>; - foreach $data (@updatelist) - { - if (-e "$data/source.url") - { - open (FILE,"$data/source.url"); - $sourceurl=3D; - close FILE; - chomp($sourceurl); - $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($source= url)); - - my $size_updatefile =3D 0; - if(-e "$data/$updatefile") { - $size_updatefile =3D (-s "$data/$updatefile"); - } - else - { - # DEBUG - #die "file not found: $data/$updatefile\n"; - } - # - # Total file size - # - $filesize +=3D $size_updatefile; - # - # File size for this source - # - $vendorstats{$vendorid."_filesize"} +=3D $size_updatefile; - # - # Number of requests from cache for this source - # - open (FILE,"$data/access.log"); - @requests=3D; - close FILE; - chomp(@requests); - $counts =3D @requests; - $counts--; - $vendorstats{$vendorid."_requests"} +=3D $counts; - $cachehits +=3D $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"); - $_=3D; - close FILE; - chomp; - $vendorstats{$vendorid."_".$_}++; - # - # Calculate cached traffic for this source - # - $vendorstats{$vendorid."_cachehits"} +=3D $counts * $size_updatefile; - # - # Calculate total cached traffic - # - $cachedtraffic +=3D $counts * $size_updatefile; +# ------------------------------------------------------------------- +# Initialize Cachestats +# ------------------------------------------------------------------- =20 - } - } +sub initcachestats { + @sources=3D(); + foreach (<$repository/*>) { + if (-d $_) { + unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/))= { push(@sources,$_); } + } + } + @vendors=3D(); + foreach (@sources) + { + $vendorid=3Dsubstr($_,rindex($_,'/')+1,length($_)); + push(@vendors,$vendorid); + $vendorstats{$vendorid."_filesize"} =3D 0; + $vendorstats{$vendorid."_requests"} =3D 0; + $vendorstats{$vendorid."_files"} =3D 0; + $vendorstats{$vendorid."_cachehits"} =3D 0; + $vendorstats{$vendorid."_0"} =3D 0; + $vendorstats{$vendorid."_1"} =3D 0; + $vendorstats{$vendorid."_2"} =3D 0; + $vendorstats{$vendorid."_3"} =3D 0; + @updatelist=3D<$_/*>; + foreach $data (@updatelist) { + if (-e "$data/source.url") { + open (FILE,"$data/source.url"); + $sourceurl=3D; + close FILE; + chomp($sourceurl); + $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($s= ourceurl)); + my $size_updatefile =3D 0; + if(-e "$data/$updatefile") { + $size_updatefile =3D (-s "$data/$updatefile"); + } + else { + # DEBUG + #die "file not found: $data/$updatefile\n"; + } + # + # Total file size + # + $filesize +=3D $size_updatefile; + # + # File size for this source + # + $vendorstats{$vendorid."_filesize"} +=3D $size_updatefile; + # + # Number of requests from cache for this source + # + open (FILE,"$data/access.log"); + @requests=3D; + close FILE; + chomp(@requests); + $counts =3D @requests; + $counts--; + $vendorstats{$vendorid."_requests"} +=3D $counts; + $cachehits +=3D $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"); + $_=3D; + close FILE; + chomp; + $vendorstats{$vendorid."_".$_}++; + # + # Calculate cached traffic for this source + # + $vendorstats{$vendorid."_cachehits"} +=3D $counts * $size_updatefile; + # + # Calculate total cached traffic + # + $cachedtraffic +=3D $counts * $size_updatefile; + } + } + } + if ($numfiles) { $efficiency =3D sprintf("%.1f", $cachehits / $numfiles); } } =20 -if ($numfiles) { $efficiency =3D sprintf("%.1f", $cachehits / $numfiles); } - -1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; -1 while $cachedtraffic =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - # ---------------------------------------------------- -# Show statistics +# Print statistics # ---------------------------------------------------- =20 -&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}"); - -unless ($numfiles) { print "$Lang::tr{'updxlrtr empty repository'}\n<= hr size=3D'1'>\n"; } - -print < -$Lang::tr{'updxlrtr disk usage'} +sub printcachestatistics { + if ($numfiles) { + $filesize =3D &format_size($filesize); + $cachedtraffic =3D &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 + + - - - - - - - - -END -; - -open(DF,"/bin/df -h $repository|"); -(a)dfdata =3D ; -close DF; -shift(@dfdata); -chomp(@dfdata); -$dfstr =3D join(' ',@dfdata); -my ($device,$size,$used,$free,$percent,$mount) =3D split(' ',$dfstr); - -print < - - - - - + + END ; - -if ($numfiles) -{ + &printtblstatdata(\@vendors); print < -
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free +
+ + +++++++ + + + + + + + + + + + + + + + - -
$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 ; -&percentbar($percent); -print < -$percent
+ &printlegendstatus(); + 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'}:$cachedtraff= ic
-
- - - - - - - - - - - - - - - - - - - END ; +} =20 -$id =3D 0; - -foreach (@vendors) -{ - $vendorid =3D $_; - - unless ($vendorstats{$vendorid . "_files"}) { next; } - - $id++; - if ($id % 2) { - print "\n"; } +sub printtblstatdata { + my $vendlst_ref =3D shift; + my $vendorid; + $id =3D 0; + unless (@$vendlst_ref) { print "\n\n\n"; } else { - print "\n"; } - - print "\n"; - print "\n"; - } elsif ($vendorid =3D~ /^Microsoft$/i) - { - print "3D'Micros= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^Symantec$/i) - { - print "3D'Syman= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^Linux$/i) - { - print "3D'Linux'}'= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^TrendMicro$/i) - { - print "3D'Tre= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^Apple$/i) - { - print "3D'Apple'}'= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^Avast$/i) - { - print "3D'Avast'}= \n"; - print "\n"; - } elsif ($vendorid =3D~ /^Avira$/i) - { - print "3D'Avira' \n"; - print "\n"; - } elsif ($vendorid =3D~ /^AVG$/i) - { - print "3D'AVG'&nb= sp;\n"; - print "\n"; - } elsif ($vendorid =3D~ /^Ipfire$/i) - { - print "3D'I= \n"; - print "\n"; - } else - { - if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . "= .gif") - { - print " \n"; - } else { - print "3D'" \n"; + foreach (@$vendlst_ref) { + $vendorid =3D $_; + 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"} =3D '0'; } + print "\t\t\n"; + unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."= _cachehits"} =3D '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 +=3D 1; } - print "\n"; } - - print "\n"; - - unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_fil= esize"} =3D '0'; } - 1 while $vendorstats{$vendorid."_filesize"} =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - print "\n"; - - unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_ca= chehits"} =3D '0'; } - 1 while $vendorstats{$vendorid."_cachehits"} =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - print "\n"; - - print "\n"; - - print "\n"; - - print "\n"; - - print "\n"; - - print "\n"; - print "\n"; + } } +# ------------------------------------------------------------------- +# Initialize Repositorydata +# ------------------------------------------------------------------- =20 -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 c= ache'}  -  <= /td> -    -  
$Lang::tr{'updxlrt= r empty repository'}.
 "; - - if ($vendorid =3D~ /^Adobe$/i) - { - print "3D'Adobe'}'=  Adobe  Microsoft  Symantec  Linux  Trend Micro  Apple  Avast  Avira  AVG  IPFire 
". ucfirs= t $vendorid ."". u= cfirst $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 "
 " . 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"; - -print < - - - - - - - - - - - - - - - - - -
  $Lang::tr{'legend'}: $Lang::tr{'updxlrtr condition ok'}   3D'$Lang::tr{'updxlrtr$Lang::tr{'updxlrtr condition nosource'}   =3D'$Lang::tr{'updxlrtr$Lang::tr{'updxlrtr condition outdated'}   $Lang::tr{'updxlrtr condition unknown'}   
-END -; - -} +sub inittblreposdata { + @sources =3D <$repository/download/*>; + undef @repositoryfiles; + foreach (@sources) { + if (-d) { + @updatelist =3D <$_/*>; + $vendorid =3D substr($_,rindex($_,"/")+1); + foreach(@updatelist) { + next if(/\.info$/); + $updatefile =3D substr($_,rindex($_,"/")+1); + $updatefile .=3D ":download/$vendorid/$updatefile"; + $updatefile =3D " ".$updatefile; + push(@repositoryfiles,$updatefile); + } + } + } =20 -&Header::closebox(); + undef (@sources); + foreach (<$repository/*>) { + if (-d $_) { + unless (/^$repository\/download$/) { push(@sources,$_); } + } + } =20 + foreach (@sources) { + @updatelist=3D<$_/*>; + $vendorid =3D substr($_,rindex($_,"/")+1); + foreach(@updatelist) { + $uuid =3D substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") { + open (FILE,"$_/source.url"); + $sourceurl=3D; + close FILE; + chomp($sourceurl); + $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($s= ourceurl)); + $_ =3D $updatefile; tr/[A-Z]/[a-z]/; + $updatefile =3D "$_:$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } + } + @repositoryfiles =3D sort { ($a =3D~ /.*?:(.*\/).*?/)[0] cmp ($b =3D~ /.*?= :(.*\/).*?/)[0] } @repositoryfiles; } =20 -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -# CACHE MAINTENANCE -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') -{ - - -# ---------------------------------------------------- -# File list dialog -# ---------------------------------------------------- - -&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}"); - -(a)sources=3D <$repository/download/*>; +# ------------------------------------------------------------------- +# Initialize Cache-Maintenance Form +# ------------------------------------------------------------------- =20 -undef @repositoryfiles; -foreach (@sources) -{ - if (-d) - { - @updatelist =3D <$_/*>; - $vendorid =3D substr($_,rindex($_,"/")+1); - foreach(@updatelist) - { - next if(/\.info$/); - $updatefile =3D substr($_,rindex($_,"/")+1); - $updatefile .=3D ":download/$vendorid/$updatefile"; - $updatefile =3D " ".$updatefile; - push(@repositoryfiles,$updatefile); - } - } +sub initfrmmaintenance { + $selected{'NOT_ACCESSED_LAST'}{'week'} =3D ''; + $selected{'NOT_ACCESSED_LAST'}{'month1'} =3D ''; + $selected{'NOT_ACCESSED_LAST'}{'month3'} =3D ''; + $selected{'NOT_ACCESSED_LAST'}{'month6'} =3D ''; + $selected{'NOT_ACCESSED_LAST'}{'year'} =3D ''; + $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} =3D = "selected=3D'selected'"; + $checked{'REMOVE_NOSOURCE'}{'off'} =3D ''; + $checked{'REMOVE_NOSOURCE'}{'on'} =3D ''; + $checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} =3D "chec= ked=3D'checked'"; + $checked{'REMOVE_OUTDATED'}{'off'} =3D ''; + $checked{'REMOVE_OUTDATED'}{'on'} =3D ''; + $checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} =3D "chec= ked=3D'checked'"; + $checked{'REMOVE_UNKNOWN'}{'off'} =3D ''; + $checked{'REMOVE_UNKNOWN'}{'on'} =3D ''; + $checked{'REMOVE_UNKNOWN'}{$xlratorsettings{'REMOVE_UNKNOWN'}} =3D "checke= d=3D'checked'"; + $checked{'REMOVE_TODELETE'}{'off'} =3D ''; + $checked{'REMOVE_TODELETE'}{'on'} =3D ''; + $checked{'REMOVE_TODELETE'}{$xlratorsettings{'REMOVE_TODELETE'}} =3D "chec= ked=3D'checked'"; + $checked{'TODELETE'}{'off'} =3D ''; + $checked{'TODELETE'}{'on'} =3D ''; + $checked{'TODELETE'}{$xlratorsettings{'TODELETE'}} =3D "checked=3D'checked= '"; } =20 -undef (@sources); -foreach (<$repository/*>) -{ - if (-d $_) -{ - unless (/^$repository\/download$/) { push(@sources,$_); } - } -} +# ------------------------------------------------------------------- +# Print Cache-Maintenance Form - printfrmmaintenance('withfiles', \@reposito= ryfiles) +# ------------------------------------------------------------------- =20 -foreach (@sources) -{ - @updatelist=3D<$_/*>; - $vendorid =3D substr($_,rindex($_,"/")+1); - foreach(@updatelist) - { - $uuid =3D substr($_,rindex($_,"/")+1); - if (-e "$_/source.url") - { - open (FILE,"$_/source.url"); - $sourceurl=3D; - close FILE; - chomp($sourceurl); - $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($source= url)); - $_ =3D $updatefile; tr/[A-Z]/[a-z]/; - $updatefile =3D "$_:$vendorid/$uuid/$updatefile"; - push(@repositoryfiles,$updatefile); - } - } +sub printfrmmaintenance { + my $param =3D shift; + my $repos_ref =3D shift; + my $disabled =3D ''; + unless (@$repos_ref) { $disabled =3D "disabled=3D'disabled'"; } + print < +
+ $Lang::tr{'updxlrtr all files'} + + + +
+
+ $Lang::tr{'updxlrtr marked as'} ... + + + + + + + + +
+
+ +
+END +; + if ($param =3D~ /withfiles/i) + { &printtblrepository($Lang::tr{'updxlrtr current files'}, $repos_ref); } + print "\n"; } =20 -(a)repositoryfiles =3D sort(@repositoryfiles); - -unless (@repositoryfiles) { print "$Lang::tr{'updxlrtr empty repository'}= \n
\n"; } +# ------------------------------------------------------------------- +# Print current files in repository - printreposfiles($title, \@files) +# ------------------------------------------------------------------- =20 -print < -$Lang::tr{'updxlrtr disk usage'} - - - - - - - - - +sub printtblrepository { + my $title =3D shift; + my $files =3D shift; + + print < +
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
+ ++++++ + + + + + + + + + + + + + + + - - - - + + + END ; -&percentbar($percent); -print < - - -
$title
$Lang::tr{'status'}$Lang::tr{'updxlrtr source'}$Lang::tr{'updxlrtr filename'}$Lang::tr{'updxlrtr filesize'}$Lang::tr{'date'}
END ; - -open(DF,"/bin/df -h $repository|"); -(a)dfdata =3D ; -close DF; -shift(@dfdata); -chomp(@dfdata); -$dfstr =3D join(' ',@dfdata); -my ($device,$size,$used,$free,$percent,$mount) =3D split(' ',$dfstr); - +&printlegendicons(); +&printlegendstatus(); +&printlegendsource(); print < -[$repository]$size$used$free +
$percent
+ unless (@$files) { print "\t\n\t\t$Lang::tr{'updxlrt= r empty repository'}.\n\t\n"; } + else { + $id =3D 0; + foreach $updatefile (@$files) { + $updatefile =3D~ s/.*://; + my $size_updatefile =3D 0; + my $mtime =3D 0; + if(-e "$repository/$updatefile") { + $size_updatefile =3D (-s "$repository/$updatefile"); + $mtime =3D &getmtime("$repository/$updatefile"); + } + print "\t\n"; + $filesize =3D &format_size($size_updatefile); + my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($mtim= e); + $DAYdt =3D sprintf ("%.02d",$DAYdt); + $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); + $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); + $filedate =3D $DAYdt.".".$MONTHdt.".".$YEARdt; + $lastaccess =3D "n/a"; + $lastcheck =3D "n/a"; + $status =3D $sfUnknown; + unless ($updatefile =3D~ /^download\//) { + ($vendorid,$uuid,$shortname) =3D split('/',$updatefile); + if (-e "$repository/$vendorid/$uuid/access.log") { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata =3D ; + close(FILE); + chomp @metadata; + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($met= adata[-1]); + $DAYdt =3D sprintf ("%.02d",$DAYdt); + $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); + $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =3D~ /^\d+/) && ($metadata[-1] >=3D 1)) + { $lastaccess =3D $DAYdt.".".$MONTHdt.".".$YEARdt; } + } + if (-e "$repository/$vendorid/$uuid/checkup.log") { + open (FILE,"$repository/$vendorid/$uuid/checkup.log"); + @metadata =3D ; + close(FILE); + chomp @metadata; + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($met= adata[-1]); + $DAYdt =3D sprintf ("%.02d",$DAYdt); + $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); + $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =3D~ /^\d+/) && ($metadata[-1] >=3D 1)) + { $lastcheck =3D $DAYdt.".".$MONTHdt.".".$YEARdt; } + } + if (-e "$repository/$vendorid/$uuid/status") { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata =3D ; + close(FILE); + chomp @metadata; + $status =3D $metadata[-1]; + } + } + else { + ($uuid,$vendorid,$shortname) =3D split('/',$updatefile); + $status =3D $sfOutdated; + } + =20 + if ($status =3D=3D $sfUnknown) + { print "\t\t \n"; } + elsif ($status =3D=3D $sfOk) + { print "\t\t \n"; } + elsif ($status =3D=3D $sfNoSource) + { print "\t\t \n"; } + elsif (($status =3D=3D $sfOutdated) && (!($updatefile =3D~ /^download\= //i))) + { print "\t\t \n"; } + elsif (($status =3D=3D $sfOutdated) && ($updatefile =3D~ /^download\//= i)) + { print "\t\t \n"; } + if ($vendimg{$vendorid}) { + print "\t\t \n= "; } + else { + print "\t\t \n"; + } + $shortname =3D substr($updatefile,rindex($updatefile,"/")+1); + unless ($vendorid ne 'microsoft') { $shortname =3D~ s/(.*)_[\da-f]*(\.(ex= e|cab|psf)$)/$1\[...\] $2/i; } + unless (length($shortname) <=3D 50) { + my $fext =3D substr($shortname,rindex("$shortname",'.')); + $shortname =3D substr($shortname,0,44-length($fext)); + $shortname .=3D "[...] $fext"; + } + print <$sho= rtname + $filesize + $filedate + $lastaccess + $lastcheck + + END ; - -if (@repositoryfiles) -{ - print < -
- - - - - - - - - - - - - - - + $id +=3D 1; + } + } + print <
 $Lang::tr{'updxlrtr all files'} - -  $Lang::tr{'updxlrtr not accessed'} - - -
-  $Lang::tr{'updxlrtr marked as'} - 3D'$Lang::tr{'updxlrtr[$Lang::tr{'updxlrtr condition nosource= '}] -  $Lang::tr{'updxlrtr marked as'} - 3D'$Lang::tr{'updxlrtr[$Lang::tr{'updxlrtr condition outdated= '}]
-
END ; - - &printcurrentfiles($Lang::tr{'updxlrtr current files'}, @repositoryfiles); - print "
\n\n"; - &printlegendicons(); - &printlegendspacer(); - &printlegendstatus(); - &printlegendspacer(); - &printlegendsource(); - print "
\n"; } =20 -&Header::closebox(); +# ------------------------------------------------------------------- +# cancels pending download - need updatefile(-ID) +# ------------------------------------------------------------------- =20 +sub canceldownload { + $updatefile =3D shift; + if ($updatefile =3D~ /^download\//) { + ($uuid,$vendorid,$updatefile) =3D split('/',$updatefile); + if (-e "$repository/download/$vendorid/$updatefile.info") { + &General::readhash("$repository/download/$vendorid/$updatefile.info", = \%dlinfo); + $id =3D &getPID("\\s${General::swroot}/updatexlrator/bin/download\\s.*= \\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$"); + if ($id) { system("/bin/kill -9 $id"); } + $id =3D &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'}= )."\$"); + if ($id) { system("/bin/kill -9 $id"); } + system("rm \"$repository/download/$vendorid/$updatefile.info\""); + } + =20 + if (-e "$repository/download/$vendorid/$updatefile") { + system("rm \"$repository/download/$vendorid/$updatefile\""); + } + } } =20 -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -&Header::closebigbox(); - -&Header::closepage(); - +# ------------------------------------------------------------------- +# Delete old and selected cached files # ------------------------------------------------------------------- =20 -sub printcurrentfiles -{ - my $title =3D shift; - my @files =3D @_; - - print < -$Lang::tr{'updxlrtr current files'} - - - - - - - - - - - - - - -END -; - $id =3D 0; - foreach $updatefile (@files) - { - $updatefile =3D~ s/.*://; - my $size_updatefile =3D 0; - my $mtime =3D 0; - if(-e "$repository/$updatefile") { - $size_updatefile =3D (-s "$repository/$updatefile"); - $mtime =3D &getmtime("$repository/$updatefile"); - } +sub delolddata { + undef (@sources); + undef @repositoryfiles; + foreach (<$repository/*>) { + if (-d $_) { + unless (/^$repository\/download$/) { push(@sources,$_); } + } + } + =20 + foreach (@sources) { + @updatelist=3D<$_/*>; + $vendorid =3D substr($_,rindex($_,"/")+1); + foreach(@updatelist) { + $uuid =3D substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") { + open (FILE,"$_/source.url"); + $sourceurl=3D; + close FILE; + chomp($sourceurl); + $updatefile =3D substr($sourceurl,rindex($sourceurl,'/')+1,length($s= ourceurl)); + $updatefile =3D "$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } + } + =20 + foreach (@repositoryfiles) { + ($vendorid,$uuid,$updatefile) =3D split('/'); + if (-e "$repository/$vendorid/$uuid/status") { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata =3D ; + close FILE; + chomp(@metadata); + $status =3D $metadata[-1]; + } + =20 + if (-e "$repository/$vendorid/$uuid/access.log") { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata =3D ; + close FILE; + chomp(@metadata); + $lastaccess =3D $metadata[-1]; + } + =20 + if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status =3D=3D $sf= NoSource)) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$r= epository/$vendorid/$uuid\""); } + } + =20 + if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status =3D=3D $sf= Outdated)) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$r= epository/$vendorid/$uuid\""); } + } + =20 + if (($xlratorsettings{'REMOVE_UNKNOWN'} eq 'on') && ($status =3D=3D $sfU= nknown)) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$r= epository/$vendorid/$uuid\""); } + } =20 - $id++; - if ($id % 2) { - print "\n"; } - else { - print "\n"; } - - $filesize =3D $size_updatefile; - 1 while $filesize =3D~ s/^(-?\d+)(\d{3})/$1.$2/; - - my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($mtime); - $DAYdt =3D sprintf ("%.02d",$DAYdt); - $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); - $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); - $filedate =3D $YEARdt."-".$MONTHdt."-".$DAYdt; - - $lastaccess =3D "n/a"; - $lastcheck =3D "n/a"; - - $status =3D $sfUnknown; - - unless ($updatefile =3D~ /^download\//) - { - ($vendorid,$uuid,$shortname) =3D split('/',$updatefile); - - if (-e "$repository/$vendorid/$uuid/access.log") - { - open (FILE,"$repository/$vendorid/$uuid/access.log"); - @metadata =3D ; - close(FILE); - chomp @metadata; - - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($metadata[= -1]); - $DAYdt =3D sprintf ("%.02d",$DAYdt); - $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); - $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); - if (($metadata[-1] =3D~ /^\d+/) && ($metadata[-1] >=3D 1)) { $lastaccess= =3D $YEARdt."-".$MONTHdt."-".$DAYdt; } - } - if (-e "$repository/$vendorid/$uuid/checkup.log") - { - open (FILE,"$repository/$vendorid/$uuid/checkup.log"); - @metadata =3D ; - close(FILE); - chomp @metadata; - - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) =3D localtime($metadata[= -1]); - $DAYdt =3D sprintf ("%.02d",$DAYdt); - $MONTHdt =3D sprintf ("%.02d",$MONTHdt+1); - $YEARdt =3D sprintf ("%.04d",$YEARdt+1900); - if (($metadata[-1] =3D~ /^\d+/) && ($metadata[-1] >=3D 1)) { $lastcheck = =3D $YEARdt."-".$MONTHdt."-".$DAYdt; } - } - if (-e "$repository/$vendorid/$uuid/status") - { - open (FILE,"$repository/$vendorid/$uuid/status"); - @metadata =3D ; - close(FILE); - chomp @metadata; - $status =3D $metadata[-1]; - } - } else { - ($uuid,$vendorid,$shortname) =3D split('/',$updatefile); - $status =3D $sfOutdated; - } + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (ti= me - 604800))) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repo= sitory/$vendorid/$uuid\""); } + } + elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess = < (time - 2505600))) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repo= sitory/$vendorid/$uuid\""); } + } + elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess = < (time - 7516800))) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repo= sitory/$vendorid/$uuid\""); } + } + elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess = < (time - 15033600))) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repo= sitory/$vendorid/$uuid\""); } + } + elsif (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < = (time - 31536000))) { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r \"$repo= sitory/$vendorid/$uuid\""); } + } =20 - print "\t\t\n"; - } - if ($status =3D=3D $sfOk) - { - print "3D'$Lang::= \n"; - } - if ($status =3D=3D $sfNoSource) - { - print "3D'$Lang:= \n"; - } - if (($status =3D=3D $sfOutdated) && (!($updatefile =3D~ /^download\//i))) - { - print "3D'$Lang::tr= \n"; - } - if (($status =3D=3D $sfOutdated) && ($updatefile =3D~ /^download\//i)) - { - print "3D'$Lang::t= \n"; - } + =20 + if (($xlratorsettings{'REMOVE_TODELETE'} eq 'on') && ($xlratorsettings{'= TODELETE'} ne 'off')) { + my @todelete =3D split(/\|/, $xlratorsettings{'TODELETE'}); + foreach (@todelete) { + unless ($_ =3D~ /^download\//) { + ($vendorid,$uuid,$cachefile) =3D split(/\//, $_); + if (-e "$repository/$vendorid/$uuid/$cachefile") { system("rm -r \= "$repository/$vendorid/$uuid\""); } + } + } + } + } +} =20 - print "\t\t\n"; - } elsif ($vendorid =3D~ /^Microsoft$/i) - { - print "3D'Micro= \n"; - } elsif ($vendorid =3D~ /^Symantec$/i) - { - print "3D'Syma= \n"; - } elsif ($vendorid =3D~ /^Linux$/i) - { - print "3D'Linux'}= \n"; - } elsif ($vendorid =3D~ /^TrendMicro$/i) - { - print "3D'Tr= \n"; - } elsif ($vendorid =3D~ /^Apple$/i) - { - print "3D'Apple'}= \n"; - } elsif ($vendorid =3D~ /^Avast$/i) - { - print "3D'Avast'}= \n"; - } elsif ($vendorid =3D~ /^Avira$/i) - { - print "3D'Avira' \n"; - } elsif ($vendorid =3D~ /^AVG$/i) - { - print "3D'AVG'&n= bsp;\n"; - } elsif ($vendorid =3D~ /^Ipfire$/i) - { - print "3D'= \n"; - } - else - { - if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . = ".gif") - { - print " \n"; - } else { - print "3D'" \n"; - } - } =20 - $shortname =3D substr($updatefile,rindex($updatefile,"/")+1); - $shortname =3D~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; +# ------------------------------------------------------------------- =20 -print <$shortname - - - - - - +sub printlegenddownload { + print <$Lang::tr{'legend'}: +
    +
  • $Lang::tr{'updxlrtr condition download'}
  • +
  • $Lang::tr{'updxlrtr condition suspended'}
  • +
  • $Lang::tr{'updxlrtr cancel download'}
  • +
END ; - } - - print "
  $Lang::tr{'updxlrtr filename'} - $Lang::tr{'updxlrtr filesize'} - $Lang::tr{'date'}3D'=3D'$Lang::tr{'updxlrtr 
 "; - if ($status =3D=3D $sfUnknown) - { - print "3D'$Lang::t=  "; - if ($vendorid =3D~ /^Adobe$/i) - { - print "3D'Adobe'}=  $filesize = ; $filedate = ; $lastaccess&nb= sp; $lastcheck&nbs= p; -
- - - -
-
\n"; - } =20 # ------------------------------------------------------------------- =20 -sub printlegenddownload -{ - print < -   $Lang::tr{'legend'}: -   - 3D'$Lang::tr{'u= - $Lang::tr{'updxlrtr condition download'} -   -   - 3D'$Lang::tr{'u= - $Lang::tr{'updxlrtr condition suspended'} -   -   - 3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr cancel download'} - +sub printlegendicons { + print <$Lang::tr{'legend'}: +
    +
  • $Lang::tr{'updxlrtr last access'}
  • +
  • $Lang::tr{'updxlrtr last checkup'}
  • +
  • $Lang::tr{'updxlrtr remove file'}
  • +
END ; } =20 # ------------------------------------------------------------------- =20 -sub printlegendicons -{ - print < -   $Lang::tr{'legend'}: -   - 3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr last access'} -   - 3D'$Lang::tr{'updx= - $Lang::tr{'updxlrtr last checkup'} -   - 3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr remove file'} -   -   -   - +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'}
  • +
END ; } =20 # ------------------------------------------------------------------- =20 -sub printlegendstatus -{ - print < -   $Lang::tr{'status'}: -   - - $Lang::tr{'updxlrtr condition ok'} -   - 3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr condition nosource'} -   - =3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr condition outdated'} -   -   - -   - - -   -   - - $Lang::tr{'updxlrtr condition download'} -   - - $Lang::tr{'updxlrtr condition unknown'} -   -   -   -   -   - -   - +sub printlegendsource { + print <$Lang::tr{'updxlrtr sources'}: +
    END ; + foreach my $name (sort keys %vendimg) { + if ($name =3D~ /^unknown$/i) { + print "\t
  • ". ucfirst $Lang::tr{$name= } ."
  • \n"; + } else { + print "\t
  • ". ucfirst $name ."
  • \n"; + } + } + print "
\n"; } =20 # ------------------------------------------------------------------- +# 2012-12-18: +# Seaching updbooster-image dir for all available images of format "updxl-sr= c-.gif" +# Build a hash in format '' -> '/images/updbooster/updxl-src-<= vendor>.gif' + +sub initvendimg { + if (opendir(DIR, "$webhome$webimgdir")) { + my @files =3D grep { /updxl-src-/ } readdir(DIR); + my @vendor =3D (); + closedir(DIR); + foreach (@files) { + @vendor =3D split (/[.-]/, $_); + $vendimg{$vendor[2]} =3D "$webimgdir/$_"; + } + } + else { + die "updxlrtr: Can't access \"$webhome$webimgdir\". Error was: $!\n"; + } +} +# ------------------------------------------------------------------- =20 -sub printlegendsource -{ - print < - - - -   $Lang::tr{'updxlrtr source'}: -   - - Adobe -   - - Apple -   - - Avast -   - - Linux - - - - +sub printtbldiskusage { + my $tabletitle =3D shift; + my $repos_ref=3Dshift; + print < +$tabletitle + -   -   - 3D'Microsoft' - Microsoft -   - 3D'Symantec' - Symantec -   - 3D'Trend - Trend Micro -   - 3D'IPFire' - IPFire + $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 =3D ; + $dudata =3D `/usr/bin/du -hs $repository`; + close DF; + shift(@dfdata); + chomp(@dfdata); + chomp($dudata); + $dfstr =3D join(' ',@dfdata); + my ($device,$size,$used,$free,$percent,$mount) =3D split(' ',$dfstr); + my ($duused,$tmp) =3D split(' ',$dudata); + print < -   -   - - Avira -   - =3D'AVG' - AVG -   - 3D'$Lang::tr{'updxlrtr - $Lang::tr{'updxlrtr other'} -   - -   + [$repository] + $size + $used + $duused + $free + +END +; + &percentbar(&cpof($duused,$size),&cpof($used,$size)); + print < - + + END ; +} =20 +# ------------------------------------------------------------------- +# Initialize Cache-Settings Form +# ------------------------------------------------------------------- + +sub initfrmsettings { + $checked{'ENABLE_LOG'}{'off'} =3D ''; + $checked{'ENABLE_LOG'}{'on'} =3D ''; + $checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} =3D "checked=3D'che= cked'"; + $checked{'PASSIVE_MODE'}{'off'} =3D ''; + $checked{'PASSIVE_MODE'}{'on'} =3D ''; + $checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} =3D "checked=3D= 'checked'"; + $checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} =3D ''; + $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} =3D ''; + $checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'= }} =3D "checked=3D'checked'"; + $checked{'ENABLE_AUTOCHECK'}{'off'} =3D ''; + $checked{'ENABLE_AUTOCHECK'}{'on'} =3D ''; + $checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} =3D "ch= ecked=3D'checked'"; + $checked{'FULL_AUTOSYNC'}{'off'} =3D ''; + $checked{'FULL_AUTOSYNC'}{'on'} =3D ''; + $checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} =3D "checked= =3D'checked'"; + $selected{'VIEW_SETTING'}{'overview'} =3D ''; + $selected{'VIEW_SETTING'}{'statistics'} =3D ''; + $selected{'VIEW_SETTING'}{'maintenance'} =3D ''; + $selected{'VIEW_SETTING'}{'settings'} =3D ''; + $selected{'VIEW_SETTING'}{$xlratorsettings{'VIEW_SETTING'}} =3D "checked= =3D'checked'"; + $selected{'AUTOCHECK_SCHEDULE'}{'daily'} =3D ''; + $selected{'AUTOCHECK_SCHEDULE'}{'weekly'} =3D ''; + $selected{'AUTOCHECK_SCHEDULE'}{'monthly'} =3D ''; + $selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = =3D "selected=3D'selected'"; } =20 # ------------------------------------------------------------------- +# Print Cache-Settings Form +# ------------------------------------------------------------------- =20 -sub printlegendspacer -{ - print < -  
- +sub printfrmsettings { + print < +
+ $Lang::tr{'updxlrtr standard view'} + + + + + + + + +
+
+ $Lang::tr{'updxlrtr common settings'} + + + + + + +
+
+ $Lang::tr{'updxlrtr performance options'} + + + + +
+
+ $Lang::tr{'updxlrtr source checkup'} + + +
+
+ + +
+ END ; } =20 # ------------------------------------------------------------------- +# chksettings([save|restart]) - Check settings and/or restart proxy +# ------------------------------------------------------------------- =20 -sub savesettings -{ - - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AU= TOCHECK_SCHEDULE'} eq 'daily')) - { - system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); - } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AU= TOCHECK_SCHEDULE'} eq 'weekly')) - { - system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); - } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AU= TOCHECK_SCHEDULE'} eq 'monthly')) - { - system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1'); - } +sub chksettings { + my $param =3D shift; + my $error_ref =3D shift; + if ( $param =3D~ /save/i ) { + if (!($xlratorsettings{'MAX_DISK_USAGE'} =3D~ /^\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 '') && ((!($xlratorsetting= s{'MAX_DOWNLOAD_RATE'} =3D~ /^\d+$/)) + || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) { + push(@$error_ref, $Lang::tr{'updxlrtr invalid download rate'}); + } + unless (@$error_ref >=3D 1) { &savesettings; } + } + if ($param =3D~ /restart/i ) { + if ((!(-e "${General::swroot}/proxy/enable")) && (!(-e "${General::swroo= t}/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 >=3D 1) { system('/usr/local/bin/squidctrl restart >= /dev/null 2>&1'); } + } + unless (@$error_ref =3D=3D 0) { &initfrmsettings; } +} =20 - # 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 =3D $xlratorsettings{'REMOVE_OBSOLETE'}; - my $nosource =3D $xlratorsettings{'REMOVE_NOSOURCE'}; - my $outdated =3D $xlratorsettings{'REMOVE_OUTDATED'}; - my $gui =3D $xlratorsettings{'EXTENDED_GUI'}; +# ------------------------------------------------------------------- =20 - delete($xlratorsettings{'REMOVE_OBSOLETE'}); - delete($xlratorsettings{'REMOVE_NOSOURCE'}); - delete($xlratorsettings{'REMOVE_OUTDATED'}); +sub savesettings { + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'A= UTOCHECK_SCHEDULE'} eq 'daily')) + { system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); } + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'A= UTOCHECK_SCHEDULE'} eq 'weekly')) + { system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); } + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'A= UTOCHECK_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 =3D $xlratorsettings{'REMOVE_UNKNOWN'}; + my $nosource =3D $xlratorsettings{'REMOVE_NOSOURCE'}; + my $outdated =3D $xlratorsettings{'REMOVE_OUTDATED'}; + my $todelete =3D $xlratorsettings{'REMOVE_TODELETE'}; + my $gui =3D $xlratorsettings{'EXTENDED_GUI'}; + my $show =3D $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", \%xlrator= settings); + + # put temp variables back into the hash + $xlratorsettings{'REMOVE_UNKNOWN'} =3D $obsolete; + $xlratorsettings{'REMOVE_NOSOURCE'} =3D $nosource; + $xlratorsettings{'REMOVE_OUTDATED'} =3D $outdated; + $xlratorsettings{'REMOVE_TODELETE'} =3D $todelete; + $xlratorsettings{'EXTENDED_GUI'} =3D $gui; + $xlratorsettings{'show'} =3D $show; +} =20 - delete($xlratorsettings{'EXTENDED_GUI'}); =20 - &General::writehash("${General::swroot}/updatexlrator/settings", \%xlrators= ettings); +# ------------------------------------------------------------------- +# percentbar(number[, number2, number(n)) - need absolute values +# - print relative bars ([##1][##2(number2-number1)][#n-#2-#1]...) +# ------------------------------------------------------------------- =20 - # put temp variables back into the hash - $xlratorsettings{'REMOVE_OBSOLETE'} =3D $obsolete; - $xlratorsettings{'REMOVE_NOSOURCE'} =3D $nosource; - $xlratorsettings{'REMOVE_OUTDATED'} =3D $outdated; - $xlratorsettings{'EXTENDED_GUI'} =3D $gui; +sub percentbar { + $counts =3D '0'; + my $width =3D '-0'; # width of value bar + my $widthmax =3D '-0'; # overall width + my $tmp =3D ''; + my @tmplst; + my $sf =3D 1; # scale-factor + print "
"; + @_ =3D sort{ $a <=3D> $b } @_; + for (@_) { + unless ($widthmax <=3D 100.0) { next; }; + $width =3D $_-($widthmax); + $widthmax =3D $_; + if (($width > 0) && ($width < 1)) { $width=3D1; } + $tmp .=3D "
\n"; + $counts =3D $counts + 1; + } + $widthmax =3D sprintf("%0d",$widthmax); + if ( $widthmax < 79) { $tmp .=3D "$widthmax%\n"= ; } + else { $tmp .=3D "$widthmax%\n"; } + =20 + print "\t\t$tmp
\n"; + return; } =20 # ------------------------------------------------------------------- +# 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 +# ------------------------------------------------------------------- =20 -sub percentbar -{ - my $percent =3D $_[0]; - my $fg =3D '#a0a0a0'; - my $bg =3D '#e2e2e2'; - - if ($percent =3D~ m/^(\d+)%$/ ) - { - print < - -END -; - if ($percent eq "100%") { - print "" - } elsif ($percent eq "0%") { - print "" - } else { - print "" - } - print <= -END -; - } +sub format_size{ + my $fsize =3D shift; + =20 + 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"; } } =20 # ------------------------------------------------------------------- =20 sub getmtime { - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blks= ize,$blocks) =3D stat($_[0]); - - return $mtime; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blk= size,$blocks) =3D stat($_[0]); + return $mtime; } =20 # ------------------------------------------------------------------- =20 sub getPID { - my $pid=3D''; - my @psdata=3D`ps ax --no-heading`; - - foreach (@psdata) - { - if (/$_[0]/) { ($pid)=3D/^\s*(\d+)/; } - } + my $pid=3D''; + my @psdata=3D`ps ax --no-heading`; =20 - return $pid; + foreach (@psdata) + { if (/$_[0]/) { ($pid)=3D/^\s*(\d+)/; } } + return $pid; } =20 # ------------------------------------------------------------------- +# Calculating Percentage of 2 Values (for percentbar) +# ------------------------------------------------------------------- + +sub cpof { + my $Value; + my $MValue; + my $result;=09 + my $Vsize; + my $MVsize; + my $corf; + my $callme =3D "cpof\(value[B|K|M|G|T|P|E], maxvalue[B|K|M|G|T|P|E]\)"; + $Value =3D shift; + $MValue =3D shift; + my %cf =3D ('B'=3D>0,'K'=3D>1,'M'=3D>2,'G'=3D>3,'T'=3D>4,'P'=3D>5,'E'=3D>6); + unless ('$Value' ne '') { die "updxlrtr sub cpof: value not given: $!\n$cal= lme"; } + unless ('$MValue' ne '') { die "updxlrtr sub cpof: maxvalue not given: $!\n= $callme"; } +=09 + unless ($Value =3D~ /\d+(B|K|M|G|T|P|E)/) { die "updxlrtr: cpof() - value h= as no size!\nPossible Values: 'number[B|K|M|G|T|P|E]'\n"; } + else { $Vsize =3D chop $Value; } + unless ($MValue =3D~ /\d+(B|K|M|G|T|P|E)/) { die "updxlrtr: cpof(): maxvalu= e has no size!\nPossible Values: 'number[B|K|M|G|T|P|E]'\n"; } + else { $MVsize =3D chop $MValue; } +=09 + if ('$Vsize' eq '$MVsize') { $result =3D (100/$MValue)*$Value; } + else { + if ($Value =3D~ /^0\.d+/) { $corf =3D 1; } + else { $corf =3D '0'; } + } + my $tmp =3D (100/($MValue*(2**(10*$cf{$MVsize}))))*($Value*(2**(10*($cf{$Vs= ize}-$corf)))); + $tmp =3D sprintf ("%.2f", $tmp); + return $tmp; +} diff --git a/html/html/images/updbooster/updxl-globe.gif b/html/html/images/u= pdbooster/updxl-globe.gif deleted file mode 100644 index 54e49fc..0000000 Binary files a/html/html/images/updbooster/updxl-globe.gif and /dev/null diff= er diff --git a/html/html/images/updbooster/updxl-gr.gif b/html/html/images/updb= ooster/updxl-gr.gif deleted file mode 100644 index f8b8ec0..0000000 Binary files a/html/html/images/updbooster/updxl-gr.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-led-blue.gif b/html/html/image= s/updbooster/updxl-led-blue.gif deleted file mode 100644 index 80424c9..0000000 Binary files a/html/html/images/updbooster/updxl-led-blue.gif and /dev/null d= iffer diff --git a/html/html/images/updbooster/updxl-led-gray.gif b/html/html/image= s/updbooster/updxl-led-gray.gif deleted file mode 100644 index ccac733..0000000 Binary files a/html/html/images/updbooster/updxl-led-gray.gif and /dev/null d= iffer diff --git a/html/html/images/updbooster/updxl-led-green.gif b/html/html/imag= es/updbooster/updxl-led-green.gif deleted file mode 100644 index f8b8ec0..0000000 Binary files a/html/html/images/updbooster/updxl-led-green.gif and /dev/null = differ diff --git a/html/html/images/updbooster/updxl-led-red.gif b/html/html/images= /updbooster/updxl-led-red.gif deleted file mode 100644 index 4bce21f..0000000 Binary files a/html/html/images/updbooster/updxl-led-red.gif and /dev/null di= ffer diff --git a/html/html/images/updbooster/updxl-led-yellow.gif b/html/html/ima= ges/updbooster/updxl-led-yellow.gif deleted file mode 100644 index f7e4f9a..0000000 Binary files a/html/html/images/updbooster/updxl-led-yellow.gif and /dev/null= differ diff --git a/html/html/images/updbooster/updxl-rd.gif b/html/html/images/updb= ooster/updxl-rd.gif deleted file mode 100644 index 4bce21f..0000000 Binary files a/html/html/images/updbooster/updxl-rd.gif and /dev/null differ diff --git a/html/html/images/updbooster/updxl-src-adobe.gif b/html/html/imag= es/updbooster/updxl-src-adobe.gif index ebcd551..1152105 100644 Binary files a/html/html/images/updbooster/updxl-src-adobe.gif and b/html/htm= l/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 new file mode 100644 index 0000000..99b301a Binary files /dev/null and b/html/html/images/updbooster/updxl-src-ageofconan= .gif differ diff --git a/html/html/images/updbooster/updxl-src-avira.gif b/html/html/imag= es/updbooster/updxl-src-avira.gif index 1ed0d81..86e2bb7 100644 Binary files a/html/html/images/updbooster/updxl-src-avira.gif and b/html/htm= l/images/updbooster/updxl-src-avira.gif differ diff --git a/html/html/images/updbooster/updxl-src-curse.gif b/html/html/imag= es/updbooster/updxl-src-curse.gif new file mode 100644 index 0000000..72fab86 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-curse.gif = differ diff --git a/html/html/images/updbooster/updxl-src-diabloiii.gif b/html/html/= images/updbooster/updxl-src-diabloiii.gif new file mode 100644 index 0000000..c4f3fdf Binary files /dev/null and b/html/html/images/updbooster/updxl-src-diabloiii.= gif differ diff --git a/html/html/images/updbooster/updxl-src-eveonline.gif b/html/html/= images/updbooster/updxl-src-eveonline.gif new file mode 100644 index 0000000..12f5ffa Binary files /dev/null and b/html/html/images/updbooster/updxl-src-eveonline.= gif differ diff --git a/html/html/images/updbooster/updxl-src-google.gif b/html/html/ima= ges/updbooster/updxl-src-google.gif new file mode 100644 index 0000000..e62e292 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-google.gif= differ diff --git a/html/html/images/updbooster/updxl-src-ipfire.gif b/html/html/ima= ges/updbooster/updxl-src-ipfire.gif new file mode 100644 index 0000000..2db1276 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-ipfire.gif= differ diff --git a/html/html/images/updbooster/updxl-src-kaspersky.gif b/html/html/= images/updbooster/updxl-src-kaspersky.gif index 687a6c3..dab09a8 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/im= ages/updbooster/updxl-src-mozilla.gif new file mode 100644 index 0000000..1d1e3d0 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-mozilla.gi= f differ diff --git a/html/html/images/updbooster/updxl-src-nvidia.gif b/html/html/ima= ges/updbooster/updxl-src-nvidia.gif new file mode 100644 index 0000000..f25c41e Binary files /dev/null and b/html/html/images/updbooster/updxl-src-nvidia.gif= differ diff --git a/html/html/images/updbooster/updxl-src-opera.gif b/html/html/imag= es/updbooster/updxl-src-opera.gif new file mode 100644 index 0000000..0cbf9b6 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-opera.gif = differ diff --git a/html/html/images/updbooster/updxl-src-secunia.gif b/html/html/im= ages/updbooster/updxl-src-secunia.gif new file mode 100644 index 0000000..fc980b1 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-secunia.gi= f differ diff --git a/html/html/images/updbooster/updxl-src-swtor.gif b/html/html/imag= es/updbooster/updxl-src-swtor.gif new file mode 100644 index 0000000..13fe222 Binary files /dev/null and b/html/html/images/updbooster/updxl-src-swtor.gif = differ diff --git a/html/html/images/updbooster/updxl-src-wot.gif b/html/html/images= /updbooster/updxl-src-wot.gif new file mode 100644 index 0000000..e76f48c Binary files /dev/null and b/html/html/images/updbooster/updxl-src-wot.gif di= ffer diff --git a/html/html/images/updbooster/updxl-src-wow.gif b/html/html/images= /updbooster/updxl-src-wow.gif new file mode 100644 index 0000000..e64432e Binary files /dev/null and b/html/html/images/updbooster/updxl-src-wow.gif di= ffer diff --git a/html/html/images/updbooster/updxl-yl.gif b/html/html/images/updb= ooster/updxl-yl.gif deleted file mode 100644 index f7e4f9a..0000000 Binary files a/html/html/images/updbooster/updxl-yl.gif and /dev/null differ diff --git a/html/html/themes/ipfire/images/updxl-icons.gif b/html/html/theme= s/ipfire/images/updxl-icons.gif new file mode 100644 index 0000000..bae5cb6 Binary files /dev/null and b/html/html/themes/ipfire/images/updxl-icons.gif d= iffer diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/= ipfire/include/functions.pl index 7bf2189..d4f8bf7 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -161,6 +161,7 @@ END print < + $extrahead - - -
- -
- -
-

IPFire

-

$h2

-
=20 -
-
- -
-
-
-
+
+
+
+

IPFire

+

$h2

+
=20 +
+
+
+
+
+
END ; } @@ -340,39 +334,35 @@ sub closepage () { $uptime =3D~ s/load average/$Lang::tr{'uptime load average'}/; =20 =09 print < -
- -
- =20 -
+
+
+
+
END ; &showsubsection($menu); &showsubsubsection($menu); =20 print < -
- -
=20 -
- Status: $status Uptime:$uptime +
+
+
=20 +
+ Status: $status Uptime:$uptime END ; if ($settings{'SPEED'} ne 'off') { print < - $Lang::tr{'bandwidth usage'}: +
+ $Lang::tr{'bandwidth usage'}: $Lang::tr{'incoming'}:  $Lang::tr{'outgo= ing'}: - END ; } print < -
-
+
+
+
END @@ -389,25 +379,25 @@ sub closebigbox =20 sub openbox { - $width =3D $_[0]; - $align =3D $_[1]; - $caption =3D $_[2]; + $width =3D $_[0]; + $align =3D $_[1]; + $caption =3D $_[2]; =20 - print < -
+
END ; =20 - if ($caption) { print "

$caption

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

$caption

\n"; } else { print " "; } } =20 sub closebox { - print < -
- + print < +
+ END ; } diff --git a/html/html/themes/ipfire/include/upxlr.css b/html/html/themes/ipf= ire/include/upxlr.css new file mode 100644 index 0000000..e7cc9fd --- /dev/null +++ b/html/html/themes/ipfire/include/upxlr.css @@ -0,0 +1,384 @@ +span[id^=3Dledgr],li#liledgr,label#lbledgr +{ + background-position:0 0; +} + +span[id^=3Dledbl],li#liledbl,label#lbledbl +{ + background-position:0 -20px; +} + +span[id^=3Dledye],li#liledye,label#lbledye +{ + background-position:0 -40px; +} + +span[id^=3Dledrd],li#liledrd,label#lbledrd +{ + background-position:0 -60px; +} + +span[id^=3Dledgy],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^=3Ddel] +{ + 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^=3Dtext],label[for^=3Dselect] +{ + padding-right:.2em; +} + +label.symbols +{ + display:inline-block; + min-height:20px; + padding-left:25px; + width:auto; +} + +button[id^=3Ddel] +{ + border-style:none; +} + +input:invalid +{ + border:2px solid red; +} + +input#text01 +{ + height:1em; + max-width:120px; +} + +input#text02 +{ + width:7em; +} + +input[type=3Dsubmit] { + 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^=3Dlist] 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^=3Dvd].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^=3Dlegend] 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^=3Dbar] +{ + 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/mani= ac/images/Thumbs.db deleted file mode 100644 index 37ec790..0000000 Binary files a/html/html/themes/maniac/images/Thumbs.db and /dev/null differ diff --git a/html/html/themes/maniac/images/updxl-icons.gif b/html/html/theme= s/maniac/images/updxl-icons.gif new file mode 100644 index 0000000..bae5cb6 Binary files /dev/null and b/html/html/themes/maniac/images/updxl-icons.gif d= iffer diff --git a/html/html/themes/maniac/include/functions.pl b/html/html/themes/= maniac/include/functions.pl index 05c3b94..2a40be2 100644 --- a/html/html/themes/maniac/include/functions.pl +++ b/html/html/themes/maniac/include/functions.pl @@ -147,8 +147,7 @@ sub openpage { - $title - $extrahead + $title END ; if ($settings{'FX'} ne 'off') { @@ -161,87 +160,84 @@ END print < + $extrahead + END ; if ($settings{'SPEED'} ne 'off') { print < - - - + window.setTimeout("refreshInetInfo()", 3000); + } + \$(document).ready(function(){ + refreshInetInfo(); + }); + + + END ; } else { -print "\n";} + print "\n";} print < - -
- -
- -
+
+
+
END ; - if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') { - print "

$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}


";=20 - } else { - print "

-=3D IPFire =3D-


"; - } - print <+ $h2 + -
+if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') { + print "

$settings{'HOSTNAME'}.$settings{'DOMAINNAME'}

<= br />";=20 +} else { + print "

-=3D IPFire =3D-


"; +} +print <+ $h2 + +
=20 END ; @@ -281,7 +277,6 @@ sub openpagewithoutmenu { $title - $extrahead END ; if ($settings{'FX'} ne 'off') { @@ -294,38 +289,34 @@ END print < + $extrahead =20 - - + + - -
- -
- -
-

-=3D IPFire =3D-

-

+ $h2 +

-
=09 +
+
+
+

-=3D IPFire =3D-

+

+ $h2 +

+
=09 +
-
- -
-
-
-
+
+
+
+
END ; } @@ -340,39 +331,35 @@ sub closepage () { $uptime =3D~ s/load average/$Lang::tr{'uptime load average'}/; =20 =09 print <
-
- -
- =09 -
+
+
END ; &showsubsection($menu); &showsubsubsection($menu); =20 print <
-
- -
=09 -
- Status: $status Uptime:$uptime +
=09 +
+ Status: $status Uptime:$uptime END ; if ($settings{'SPEED'} ne 'off') { print < - $Lang::tr{'bandwidth usage'}: +
+ $Lang::tr{'bandwidth usage'}: $Lang::tr{'incoming'}:  $Lang::tr{'outgo= ing'}: - END ; } print < -
-
+
+
+
END @@ -395,10 +382,9 @@ sub openbox =20 print < -
+
END ; - if ($caption) { print "

$caption

\n"; } else { print " "; } } =20 diff --git a/html/html/themes/maniac/include/upxlr.css b/html/html/themes/man= iac/include/upxlr.css new file mode 100644 index 0000000..a2b2c05 --- /dev/null +++ b/html/html/themes/maniac/include/upxlr.css @@ -0,0 +1,390 @@ +span[id^=3Dledgr],li#liledgr,label#lbledgr +{ + background-position:0 0; +} + +span[id^=3Dledbl],li#liledbl,label#lbledbl +{ + background-position:0 -20px; +} + +span[id^=3Dledye],li#liledye,label#lbledye +{ + background-position:0 -40px; +} + +span[id^=3Dledrd],li#liledrd,label#lbledrd +{ + background-position:0 -60px; +} + +span[id^=3Dledgy],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^=3Ddel] +{ + 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/maniac/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^=3Dtext],label[for^=3Dselect] +{ + padding-right:.2em; +} + +label.symbols +{ + display:inline-block; + min-height:20px; + padding-left:25px; + width:auto; +} + +button[id^=3Ddel] +{ + border-style:none; +} + +input:invalid +{ + border:2px solid red; +} + +input#text01 +{ + height:1em; + max-width:120px; +} + +input#text02 +{ + width:7em; +} + +input[type=3Dsubmit] +{ + border:1px solid #2941BC; + 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 +{ + background-color:#CA2F2F; + border:1px solid #2941BC; + color:#000; + display:inline; + height:22px; + padding-left:25px; + padding-right:5px; + width:auto; + cursor: pointer; +} + +.frmshow button:disabled +{ + border:1px solid #fff; + color:#F1F1F1; + 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^=3Dlist] thead tr th +{ + border-bottom:1px dotted #fff; +} + +th +{ + text-align:center; +} + +td,th +{ + padding:3px; +} + +tbody tr:nth-child(even) +{ + background:#1C1C1C; +} + +tbody tr:nth-child(odd) +{ + background:#4F4F4F; +} + +th span.symbols,th span.vendimg +{ + vertical-align:middle!important; +} + +th span[id^=3Dvd].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^=3Dlegend] h5 +{ + font-size:.9em; +} + +div#pbar +{ + background-color:#90EE90; + border:1px solid #a0a0a0; + color:#000; + font-weight:bolder; + height:15px; + min-width:100px; + padding-right:2px; + position:relative; + text-align:left; + width:auto; +} + +div[id^=3Dbar] +{ + 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/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index aaf4d27..00053b0 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1851,7 +1851,7 @@ 'updxlrtr all files' =3D> 'alle Dateien ...', 'updxlrtr cache dir' =3D> 'Cache-Verzeichnis', 'updxlrtr cache maintenance' =3D> 'Cache-Wartung', -'updxlrtr cache size' =3D> 'Cachegr=C3=B6=C3=9Fe (Bytes)', +'updxlrtr cache size' =3D> 'Cachegr=C3=B6=C3=9Fe', 'updxlrtr cache statistics' =3D> 'Cache-Statistik', 'updxlrtr cancel download' =3D> 'Download abbrechen', 'updxlrtr children' =3D> 'Anzahl der Accelerator-Prozesse', @@ -1862,11 +1862,11 @@ 'updxlrtr condition outdated' =3D> 'Veraltet', 'updxlrtr condition suspended' =3D> 'Ausgesetzt', 'updxlrtr condition unknown' =3D> 'Unbekannt', -'updxlrtr configuration' =3D> 'Update-Accelerator-Konfiguration', 'updxlrtr current downloads' =3D> 'Dateien beim Download in den lokalen Cach= e', 'updxlrtr current files' =3D> 'Aktuelle Dateien im lokalen Cache', +'updxlrtr current view' =3D> 'Aktuelle Ansicht', 'updxlrtr daily' =3D> 't=C3=A4glich', -'updxlrtr data from cache' =3D> 'Daten vom Cache (Bytes)', +'updxlrtr data from cache' =3D> 'Daten vom Cache', 'updxlrtr disk usage' =3D> 'Festplattennutzung', 'updxlrtr efficiency index' =3D> 'Cache-Effizienz-Index', 'updxlrtr empty repository' =3D> 'Der lokale Cache ist leer', @@ -1888,29 +1888,36 @@ 'updxlrtr max download rate' =3D> 'Max. externe Downloadrate (kBit/s)', 'updxlrtr month' =3D> 'einem Monat', 'updxlrtr monthly' =3D> 'monatlich', +'updxlrtr no pending downloads attime' =3D> 'Keine Downloads zur Zeit', 'updxlrtr not accessed' =3D> 'nicht zugegriffen seit', 'updxlrtr not enabled' =3D> 'Der Update-Accelerator ist auf der Web-Proxy-Se= ite nicht aktiviert', +'updxlrtr notice dlrate' =3D> 'Wert zwischen 0 und 1000000 in 16er Abst=C3= =A4nden.', 'updxlrtr other' =3D> 'Sonstige', +'updxlrtr overview' =3D> '=C3=9Cbersicht', 'updxlrtr passive mode' =3D> 'Aktiviere Passiv-Modus', 'updxlrtr pending downloads' =3D> 'Anstehende Downloads', 'updxlrtr performance options' =3D> 'Leistungsoptionen', 'updxlrtr progress' =3D> 'Fortschritt', -'updxlrtr purge' =3D> 'Entferne', +'updxlrtr purge' =3D> 'Entfernen', 'updxlrtr remove file' =3D> 'Entferne vom Cache', 'updxlrtr save and restart' =3D> 'Speichern und neu starten', +'updxlrtr settings' =3D> 'Einstellungen', 'updxlrtr source' =3D> 'Quelle', +'updxlrtr sources' =3D> 'Quellen', 'updxlrtr source checkup' =3D> 'Quellenpr=C3=BCfung', 'updxlrtr source checkup schedule' =3D> 'Zeitplanung der Quellenpr=C3=BCfung= ', +'updxlrtr standard view' =3D> 'Standard-Ansicht', 'updxlrtr statistics' =3D> 'Statistik', 'updxlrtr statistics by source' =3D> 'Statistik pro Quelle', 'updxlrtr summary' =3D> 'Zusammenfassung', -'updxlrtr total cache size' =3D> 'Gesamtgr=C3=B6=C3=9Fe des Cache (Bytes)', -'updxlrtr total data from cache' =3D> 'Daten insgesamt vom Cache ausgeliefer= t (Bytes)', +'updxlrtr to delete' =3D> 'zum L=C3=B6schen', +'updxlrtr total cache size' =3D> 'Gesamtgr=C3=B6=C3=9Fe des Cache', +'updxlrtr total data from cache' =3D> 'Daten insgesamt vom Cache ausgeliefer= t', 'updxlrtr total files' =3D> 'Gesamtanzahl Dateien im Cache', +'updxlrtr total used' =3D> 'Insgesamt belegt', 'updxlrtr unknown' =3D> 'Unbekannt', 'updxlrtr update accelerator' =3D> 'Update-Accelerator', -'updxlrtr update information' =3D> 'Eine aktualisierte Version steht zum Dow= nload bereit. Besuchen Sie http://update-accelerator.advproxy.net f=C3=BCr weiter= e Informationen.', -'updxlrtr update notification' =3D> 'Update-Benachrichtigung!', +'updxlrtr used by' =3D> 'Belegt von', 'updxlrtr web proxy service required' =3D> 'Der Web-Proxy muss aktiviert sei= n, um den Update-Accelerator zu verwenden', 'updxlrtr week' =3D> 'einer Woche', 'updxlrtr weekly' =3D> 'w=C3=B6chentlich', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 729f309..5431e64 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1883,7 +1883,9 @@ 'updxlrtr all files' =3D> 'all files ...', 'updxlrtr cache dir' =3D> 'Cache directory', 'updxlrtr cache maintenance' =3D> 'Cache maintenance', -'updxlrtr cache size' =3D> 'Cache size (bytes)', +'updxlrtr cache overview' =3D> 'Cache overview', +'updxlrtr cache settings' =3D> 'Cache settings', +'updxlrtr cache size' =3D> 'Cache size', 'updxlrtr cache statistics' =3D> 'Cache statistics', 'updxlrtr cancel download' =3D> 'Cancel download', 'updxlrtr children' =3D> 'Number of accelerator processes', @@ -1897,8 +1899,9 @@ 'updxlrtr configuration' =3D> 'Update accelerator configuration', 'updxlrtr current downloads' =3D> 'Files being downloaded into the local cac= he', 'updxlrtr current files' =3D> 'Current files in local cache', +'updxlrtr current view' =3D> 'Current view', 'updxlrtr daily' =3D> 'daily', -'updxlrtr data from cache' =3D> 'Data from cache (bytes)', +'updxlrtr data from cache' =3D> 'Data from cache', 'updxlrtr disk usage' =3D> 'Disk usage', 'updxlrtr efficiency index' =3D> 'Cache efficiency index', 'updxlrtr empty repository' =3D> 'Local cache is empty', @@ -1920,9 +1923,12 @@ 'updxlrtr max download rate' =3D> 'Max. external download rate (kBit/s)', 'updxlrtr month' =3D> 'one month', 'updxlrtr monthly' =3D> 'monthly', +'updxlrtr no pending downloads attime' =3D> 'No pending downloads at moment', 'updxlrtr not accessed' =3D> 'not accessed since', 'updxlrtr not enabled' =3D> 'Update Accelerator is not enabled on the web pr= oxy page', +'updxlrtr notice dlrate' =3D> 'Value must between 0 and 1000000 in steps of = 16.', 'updxlrtr other' =3D> 'Other', +'updxlrtr overview' =3D> 'Overview', 'updxlrtr passive mode' =3D> 'Enable passive mode', 'updxlrtr pending downloads' =3D> 'Pending downloads', 'updxlrtr performance options' =3D> 'Performance options', @@ -1930,19 +1936,23 @@ 'updxlrtr purge' =3D> 'Purge', 'updxlrtr remove file' =3D> 'Remove from cache', 'updxlrtr save and restart' =3D> 'Save and Restart', +'updxlrtr settings' =3D> 'Settings', 'updxlrtr source' =3D> 'Source', +'updxlrtr sources' =3D> 'Sources', 'updxlrtr source checkup' =3D> 'Source checkup', 'updxlrtr source checkup schedule' =3D> 'Source checkup schedule', +'updxlrtr standard view' =3D> 'Standard view', 'updxlrtr statistics' =3D> 'Statistics', 'updxlrtr statistics by source' =3D> 'Statistics by source', 'updxlrtr summary' =3D> 'Summary', -'updxlrtr total cache size' =3D> 'Total cache size (bytes)', -'updxlrtr total data from cache' =3D> 'Total data delivered from cache (byte= s)', +'updxlrtr to delete' =3D> 'To delete', +'updxlrtr total cache size' =3D> 'Total cache size', +'updxlrtr total data from cache' =3D> 'Total data delivered from cache', 'updxlrtr total files' =3D> 'Total files in cache', +'updxlrtr total used' =3D> 'Total used', 'updxlrtr unknown' =3D> 'Unknown', +'updxlrtr used by' =3D> 'Used by', 'updxlrtr update accelerator' =3D> 'Update Accelerator', -'updxlrtr update information' =3D> 'There is an updated version available fo= r download. Visit http://update-accelerator.advproxy.net for more information.', -'updxlrtr update notification' =3D> 'Update notification!', 'updxlrtr web proxy service required' =3D> 'Web proxy service must be enable= d to use Update Accelerator', 'updxlrtr week' =3D> 'one week', 'updxlrtr weekly' =3D> 'weekly', hooks/post-receive -- IPFire 2.x development tree --===============1115932782317878585==--