]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/updatexlrator.cgi
629f8ca0e0165f1e5413b39b3a63d583a9ca94a1
3 # This code is distributed under the terms of the GPL
5 # (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net
7 # Portions (c) 2008 by dotzball - http://www.blockouttraffic.de
9 # $Id: updatexlrator.cgi,v 2.1.0 2008/07/16 00:00:00 marco.s Exp $
11 ###############################################################################
13 # IPFire.org - A linux based firewall #
14 # Copyright (C) 2005-2010 IPFire Team #
16 # This program is free software: you can redistribute it and/or modify #
17 # it under the terms of the GNU General Public License as published by #
18 # the Free Software Foundation, either version 3 of the License, or #
19 # (at your option) any later version. #
21 # This program is distributed in the hope that it will be useful, #
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
24 # GNU General Public License for more details. #
26 # You should have received a copy of the GNU General Public License #
27 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
29 ###############################################################################
32 # 2012-10-27: nightshift - Bugfix regarding showing wrong vendor icon while Download of new Updates
33 # 2012-10-27: nightshift - Optimizing logic of check for vendor icons
38 # enable only the following on debugging purpose
39 #use warnings; no warnings 'once';# 'redefine', 'uninitialized';
40 #use CGI::Carp 'fatalsToBrowser';
44 require '/var/ipfire/general-functions.pl';
45 require "${General::swroot}/lang.pl";
46 require "${General::swroot}/header.pl";
54 my %xlratorsettings=();
82 my $repository = "/var/updatecache/";
83 my $webhome = "/srv/web/ipfire/html";
84 my $hintcolour = '#FFFFCC';
85 my $colourgray = '#808080';
92 my $not_accessed_last='';
96 my @repositorylist=();
97 my @repositoryfiles=();
103 &General
::readhash
("${General::swroot}/ethernet/settings", \
%netsettings);
104 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
105 &General
::readhash
("${General::swroot}/proxy/settings", \
%proxysettings);
106 &General
::readhash
("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \
%color);
108 $xlratorsettings{'ACTION'} = '';
109 $xlratorsettings{'ENABLE_LOG'} = 'off';
110 $xlratorsettings{'PASSIVE_MODE'} = 'off';
111 $xlratorsettings{'MAX_DISK_USAGE'} = '75';
112 $xlratorsettings{'LOW_DOWNLOAD_PRIORITY'} = 'off';
113 $xlratorsettings{'MAX_DOWNLOAD_RATE'} = '';
114 $xlratorsettings{'ENABLE_AUTOCHECK'} = 'off';
115 $xlratorsettings{'FULL_AUTOSYNC'} = 'off';
116 $xlratorsettings{'NOT_ACCESSED_LAST'} = 'month1';
117 $xlratorsettings{'REMOVE_NOSOURCE'} = 'off';
118 $xlratorsettings{'REMOVE_OUTDATED'} = 'off';
119 $xlratorsettings{'REMOVE_OBSOLETE'} = 'off';
121 &Header
::getcgihash
(\
%xlratorsettings);
123 $xlratorsettings{'EXTENDED_GUI'} = '';
125 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>")
127 $xlratorsettings{'EXTENDED_GUI'} = 'statistics';
130 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>")
132 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
135 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr purge'})
137 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
139 if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on'))
142 undef @repositoryfiles;
143 foreach (<$repository/*>)
147 unless (/^$repository\/download
$/) { push(@sources,$_); }
154 $vendorid = substr($_,rindex($_,"/")+1);
157 $uuid = substr($_,rindex($_,"/")+1);
158 if (-e
"$_/source.url")
160 open (FILE
,"$_/source.url");
164 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
165 $updatefile = "$vendorid/$uuid/$updatefile";
166 push(@repositoryfiles,$updatefile);
171 foreach (@repositoryfiles)
173 ($vendorid,$uuid,$updatefile) = split('/');
175 if (-e
"$repository/$vendorid/$uuid/status")
177 open (FILE
,"$repository/$vendorid/$uuid/status");
181 $status = $metadata[-1];
184 if (-e
"$repository/$vendorid/$uuid/access.log")
186 open (FILE
,"$repository/$vendorid/$uuid/access.log");
190 $lastaccess = $metadata[-1];
193 if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource))
195 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
197 if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated))
199 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
201 if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on')
203 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800)))
205 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
207 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600)))
209 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
211 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800)))
213 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
215 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600)))
217 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
219 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000)))
221 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
228 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'save'})
230 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
232 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
235 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
237 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
244 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr save and restart'})
246 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
248 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
251 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
253 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
256 if ((!(-e
"${General::swroot}/proxy/enable")) && (!(-e
"${General::swroot}/proxy/enable_blue")))
258 $errormessage = $Lang::tr
{'updxlrtr web proxy service required'};
261 if (!($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on'))
263 $errormessage = $Lang::tr
{'updxlrtr not enabled'};
269 &General
::system('/usr/local/bin/squidctrl', 'restart');
272 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'})
274 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
276 $updatefile = $xlratorsettings{'ID'};
278 unless ($updatefile =~ /^download\//)
280 ($vendorid,$uuid,$updatefile) = split('/',$updatefile);
281 if (-e
"$repository/$vendorid/$uuid/$updatefile") { &General
::system("rm", "-r", "$repository/$vendorid/$uuid"); }
285 if (($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr cancel download'}) || ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'}))
287 $updatefile = $xlratorsettings{'ID'};
289 if ($updatefile =~ /^download\//)
291 ($uuid,$vendorid,$updatefile) = split('/',$updatefile);
293 if (-e
"$repository/download/$vendorid/$updatefile.info")
295 &General
::readhash
("$repository/download/$vendorid/$updatefile.info", \
%dlinfo);
297 $id = &getPID
("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$");
298 if ($id) { &General
::system("/bin/kill", "-9", "$id"); }
299 $id = &getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$");
300 if ($id) { &General
::system("/bin/kill", "-9", "$id"); }
302 &General
::system("rm", "$repository/download/$vendorid/$updatefile.info");
305 if (-e
"$repository/download/$vendorid/$updatefile")
307 &General
::system("rm", "$repository/download/$vendorid/$updatefile");
313 $not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'};
314 undef($xlratorsettings{'NOT_ACCESSED_LAST'});
316 if (-e
"${General::swroot}/updatexlrator/settings")
318 &General
::readhash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
321 if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '')
323 $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last;
328 $checked{'ENABLE_LOG'}{'off'} = '';
329 $checked{'ENABLE_LOG'}{'on'} = '';
330 $checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} = "checked='checked'";
331 $checked{'PASSIVE_MODE'}{'off'} = '';
332 $checked{'PASSIVE_MODE'}{'on'} = '';
333 $checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} = "checked='checked'";
334 $checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} = '';
335 $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} = '';
336 $checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}} = "checked='checked'";
337 $checked{'ENABLE_AUTOCHECK'}{'off'} = '';
338 $checked{'ENABLE_AUTOCHECK'}{'on'} = '';
339 $checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} = "checked='checked'";
340 $checked{'FULL_AUTOSYNC'}{'off'} = '';
341 $checked{'FULL_AUTOSYNC'}{'on'} = '';
342 $checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} = "checked='checked'";
343 $checked{'REMOVE_NOSOURCE'}{'off'} = '';
344 $checked{'REMOVE_NOSOURCE'}{'on'} = '';
345 $checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} = "checked='checked'";
346 $checked{'REMOVE_OUTDATED'}{'off'} = '';
347 $checked{'REMOVE_OUTDATED'}{'on'} = '';
348 $checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} = "checked='checked'";
349 $checked{'REMOVE_OBSOLETE'}{'off'} = '';
350 $checked{'REMOVE_OBSOLETE'}{'on'} = '';
351 $checked{'REMOVE_OBSOLETE'}{$xlratorsettings{'REMOVE_OBSOLETE'}} = "checked='checked'";
354 $selected{'AUTOCHECK_SCHEDULE'}{'daily'} = '';
355 $selected{'AUTOCHECK_SCHEDULE'}{'weekly'} = '';
356 $selected{'AUTOCHECK_SCHEDULE'}{'monthly'} = '';
357 $selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = "selected='selected'";
359 $selected{'NOT_ACCESSED_LAST'}{'week'} = '';
360 $selected{'NOT_ACCESSED_LAST'}{'month1'} = '';
361 $selected{'NOT_ACCESSED_LAST'}{'month3'} = '';
362 $selected{'NOT_ACCESSED_LAST'}{'month6'} = '';
363 $selected{'NOT_ACCESSED_LAST'}{'year'} = '';
364 $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selected='selected'";
366 # ----------------------------------------------------
368 # ----------------------------------------------------
370 &Header
::showhttpheaders
();
372 &Header
::openpage
($Lang::tr
{'updxlrtr configuration'}, 1, '');
374 &Header
::openbigbox
('100%', 'left', '', $errormessage);
377 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
378 print "<font class='base'>$errormessage </font>\n";
382 print "<form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>\n";
384 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr update accelerator'}");
389 <td colspan='4'><b>$Lang::tr{'updxlrtr common settings'}</b></td>
392 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable log'}:</td>
393 <td class='base' width='20%'><input type='checkbox' name='ENABLE_LOG' $checked{'ENABLE_LOG'}{'on'} /></td>
394 <td class='base' width='25%'></td>
395 <td class='base' width='30%'></td>
398 <td class='base'>$Lang::tr{'updxlrtr passive mode'}:</td>
399 <td class='base'><input type='checkbox' name='PASSIVE_MODE' $checked{'PASSIVE_MODE'}{'on'} /></td>
400 <td class='base'>$Lang::tr{'updxlrtr max disk usage'}: <img src='/blob.gif' alt='*' /></td>
401 <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='3' /> %</td>
407 <td colspan='4'><b>$Lang::tr{'updxlrtr performance options'}</b></td>
410 <td class='base' width='25%'>$Lang::tr{'updxlrtr low download priority'}:</td>
411 <td class='base' width='20%'><input type='checkbox' name='LOW_DOWNLOAD_PRIORITY' $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} /></td>
412 <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}:</td>
413 <td class='base' width='30%'><input type='text' name='MAX_DOWNLOAD_RATE' value='$xlratorsettings{'MAX_DOWNLOAD_RATE'}' size='5' /></td>
419 <td colspan='4'><b>$Lang::tr{'updxlrtr source checkup'}</b></td>
422 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable autocheck'}:</td>
423 <td class='base' width='20%'><input type='checkbox' name='ENABLE_AUTOCHECK' $checked{'ENABLE_AUTOCHECK'}{'on'} /></td>
424 <td class='base' width='25%'>$Lang::tr{'updxlrtr source checkup schedule'}:</td>
425 <td class='base' width='30%'>
426 <select name='AUTOCHECK_SCHEDULE'>
427 <option value='daily' $selected{'AUTOCHECK_SCHEDULE'}{'daily'}>$Lang::tr{'updxlrtr daily'}</option>
428 <option value='weekly' $selected{'AUTOCHECK_SCHEDULE'}{'weekly'}>$Lang::tr{'updxlrtr weekly'}</option>
429 <option value='monthly' $selected{'AUTOCHECK_SCHEDULE'}{'monthly'}>$Lang::tr{'updxlrtr monthly'}</option>
434 <td class='base'>$Lang::tr{'updxlrtr full autosync'}:</td>
435 <td class='base'><input type='checkbox' name='FULL_AUTOSYNC' $checked{'FULL_AUTOSYNC'}{'on'} /></td>
443 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
444 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr save and restart'}' /></td>
449 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr statistics'}";
450 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') { print " <<' "; } else { print " >>' "; }
453 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr maintenance'}";
454 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') { print " <<' "; } else { print " >>' "; }
467 # ----------------------------------------------------
468 # List pending downloads - if any
469 # ----------------------------------------------------
471 if (($xlratorsettings{'EXTENDED_GUI'} ne 'statistics') && ($xlratorsettings{'EXTENDED_GUI'} ne 'maintenance'))
473 @downloadlist = <$repository/download/*>;
475 undef(@downloadfiles);
476 foreach (@downloadlist)
480 my @filelist = <$_/*>;
481 $vendorid = substr($_,rindex($_,"/")+1);
485 $updatefile = substr($_,rindex($_,"/")+1);
486 $updatefile .= ":download/$vendorid/$updatefile";
487 $updatefile = " ".$updatefile;
488 push(@downloadfiles, $updatefile);
495 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr pending downloads'}");
499 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current downloads'}</b></td></tr>
502 <colgroup span='3' width='2%'></colgroup>
503 <colgroup span='1' width='0*'></colgroup>
504 <colgroup span='3' width='5%'></colgroup>
505 <colgroup span='1' width='2%'></colgroup>
507 <td class='base' align='center'> </td>
508 <td class='base' align='left' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
509 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
510 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
511 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
512 <td class='base' align='center'><i>$Lang::tr{'updxlrtr progress'}</i></td>
513 <td class='base' align='center'> </td>
518 foreach $updatefile (@downloadfiles)
520 $updatefile =~ s/.*:download/download/;
521 my $size_updatefile = 0;
523 if(-e
"$repository/$updatefile") {
524 $size_updatefile = (-s
"$repository/$updatefile");
525 $mtime = &getmtime
("$repository/$updatefile");
527 if (-e
"$repository/$updatefile.info") {
528 &General
::readhash
("$repository/$updatefile.info", \
%dlinfo);
535 print "<tr bgcolor='$Header::table1colour'>\n"; }
537 print "<tr bgcolor='$Header::table2colour'>\n"; }
539 $filesize = $size_updatefile;
540 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
542 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
543 $DAYdt = sprintf ("%.02d",$DAYdt);
544 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
545 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
546 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
548 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
550 print "\t\t<td align='center' nowrap='nowrap'> ";
551 if (&getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"))
553 print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
555 print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /> </td>\n";
558 print "\t\t<td align='center' nowrap='nowrap'> ";
560 if (($vendorid ne '') && (-e
"$webhome/images/updbooster/updxl-src-$vendorid.gif"))
562 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
564 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
567 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
568 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
570 $filesize = $dlinfo{'REMOTESIZE'};
571 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
572 $dlinfo{'VENDORID'} = ucfirst $vendorid;
575 <td class='base' align='center'> $dlinfo{'VENDORID'} </td>
576 <td class='base' align='left' title='cache:/$updatefile'>$shortname</td>
577 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
578 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
579 <td class='base' align='center' nowrap='nowrap'>
583 if ($dlinfo{'REMOTESIZE'} && $size_updatefile)
585 $percent=int(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile))."%";
587 print $percent; &percentbar
($percent);
591 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
592 <input type='image' name='$Lang::tr{'updxlrtr cancel download'}' src='/images/delete.gif' title='$Lang::tr{'updxlrtr cancel download'}' alt='$Lang::tr{'updxlrtr cancel download'}' />
593 <input type='hidden' name='ID' value='$updatefile' />
594 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr cancel download'}' />
602 print "</table>\n<br>\n<table>\n";
603 &printlegenddownload
();
609 # =====================================================================================
611 # =====================================================================================
613 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics')
616 # ----------------------------------------------------
618 # ----------------------------------------------------
621 foreach (<$repository/*>)
625 unless ((/^$repository\/download
$/) || (/^$repository\
/lost\+found$/)) { push(@sources,$_); }
632 $vendorid=substr($_,rindex($_,'/')+1,length($_));
633 push(@vendors,$vendorid);
634 $vendorstats{$vendorid."_filesize"} = 0;
635 $vendorstats{$vendorid."_requests"} = 0;
636 $vendorstats{$vendorid."_files"} = 0;
637 $vendorstats{$vendorid."_cachehits"} = 0;
638 $vendorstats{$vendorid."_0"} = 0;
639 $vendorstats{$vendorid."_1"} = 0;
640 $vendorstats{$vendorid."_2"} = 0;
641 $vendorstats{$vendorid."_3"} = 0;
643 foreach $data (@updatelist)
645 if (-e
"$data/source.url")
647 open (FILE
,"$data/source.url");
651 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
653 my $size_updatefile = 0;
654 if(-e
"$data/$updatefile") {
655 $size_updatefile = (-s
"$data/$updatefile");
660 #die "file not found: $data/$updatefile\n";
665 $filesize += $size_updatefile;
667 # File size for this source
669 $vendorstats{$vendorid."_filesize"} += $size_updatefile;
671 # Number of requests from cache for this source
673 open (FILE
,"$data/access.log");
679 $vendorstats{$vendorid."_requests"} += $counts;
680 $cachehits += $counts;
682 # Total number of files in cache
686 # Number of files for this source
688 $vendorstats{$vendorid."_files"}++;
690 # Count cache status occurences
692 open (FILE
,"$data/status");
696 $vendorstats{$vendorid."_".$_}++;
698 # Calculate cached traffic for this source
700 $vendorstats{$vendorid."_cachehits"} += $counts * $size_updatefile;
702 # Calculate total cached traffic
704 $cachedtraffic += $counts * $size_updatefile;
710 if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); }
712 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
713 1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/;
715 # ----------------------------------------------------
717 # ----------------------------------------------------
719 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}");
721 unless ($numfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
726 <td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
729 <table width='75%' cellspacing='5'>
731 <td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
732 <td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
733 <td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
734 <td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
736 <td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
741 open(DF
,"/bin/df -h $repository|");
746 $dfstr = join(' ',@dfdata);
747 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
751 <td align='center'>[$repository]</td>
752 <td align='center'>$size</td>
753 <td align='center'>$used</td>
754 <td align='center'>$free</td>
755 <td align='right' colspan='2'>
758 &percentbar
($percent);
761 <td align='center'>$percent</td>
773 <td colspan='5'><b>$Lang::tr{'updxlrtr summary'}</b></td>
776 <td class='base' width='25%'>$Lang::tr{'updxlrtr total files'}:</td>
777 <td class='base' width='20%'><font color='$colourgray'>$numfiles</font></td>
778 <td class='base' width='25%'>$Lang::tr{'updxlrtr total cache size'}:</td>
779 <td class='base' width='15%' align='right'><font color='$colourgray'>$filesize</font></td>
780 <td class='base'></td>
783 <td class='base'>$Lang::tr{'updxlrtr efficiency index'}:</td>
784 <td class='base'><font color='$colourgray'>$efficiency</font></td>
785 <td class='base'>$Lang::tr{'updxlrtr total data from cache'}:</td>
786 <td class='base' align='right'><font color='$colourgray'>$cachedtraffic</font></td>
787 <td class='base'></td>
793 <td colspan='17'><b>$Lang::tr{'updxlrtr statistics by source'}</b></td>
796 <td class='base' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
797 <td class='base' width='7%'> </td>
798 <td class='base' align='right'><i>$Lang::tr{'updxlrtr files'}</i></td>
799 <td class='base' width='7%'> </td>
800 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr cache size'}</i></nobr></td>
801 <td class='base' width='7%'> </td>
802 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr data from cache'}</i></nobr></td>
803 <td class='base' width='15%'> </td>
804 <td class='base'><img src="/images/updbooster/updxl-led-green.gif" /></td>
805 <td class='base' width='15%'> </td>
806 <td class='base'><img src="/images/updbooster/updxl-led-yellow.gif" /></td>
807 <td class='base' width='15%'> </td>
808 <td class='base'><img src="/images/updbooster/updxl-led-red.gif" /></td>
809 <td class='base' width='15%'> </td>
810 <td class='base'><img src="/images/updbooster/updxl-led-gray.gif" /></td>
811 <td class='base' width='90%'> </td>
822 unless ($vendorstats{$vendorid . "_files"}) { next; }
826 print "<tr bgcolor=''$color{'color20'}'>\n"; }
828 print "<tr bgcolor=''$color{'color22'}'>\n"; }
830 print "<td class='base' align='center'><nobr> ";
832 if ($vendorid =~ /^Adobe$/i)
834 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </nobr></td>\n";
835 print "<td class='base'> Adobe </td>\n";
836 } elsif ($vendorid =~ /^Microsoft$/i)
838 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </nobr></td>\n";
839 print "<td class='base'> Microsoft </td>\n";
840 } elsif ($vendorid =~ /^Symantec$/i)
842 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </nobr></td>\n";
843 print "<td class='base'> Symantec </td>\n";
844 } elsif ($vendorid =~ /^Linux$/i)
846 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </nobr></td>\n";
847 print "<td class='base'> Linux </td>\n";
848 } elsif ($vendorid =~ /^TrendMicro$/i)
850 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </nobr></td>\n";
851 print "<td class='base'> Trend Micro </td>\n";
852 } elsif ($vendorid =~ /^Apple$/i)
854 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </nobr></td>\n";
855 print "<td class='base'> Apple </td>\n";
856 } elsif ($vendorid =~ /^Avast$/i)
858 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </nobr></td>\n";
859 print "<td class='base'> Avast </td>\n";
860 } elsif ($vendorid =~ /^Avira$/i)
862 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
863 print "<td class='base'> Avira </td>\n";
864 } elsif ($vendorid =~ /^AVG$/i)
866 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
867 print "<td class='base'> AVG </td>\n";
868 } elsif ($vendorid =~ /^Ipfire$/i)
870 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
871 print "<td class='base'> IPFire </td>\n";
874 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
876 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
878 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
880 print "<td class='base'> " . ucfirst $vendorid . " </td>\n";
883 print "<td class='base' colspan=2 align='right'>";
884 printf "%5d", $vendorstats{$vendorid."_files"};
885 print " </td>\n";
887 unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; }
888 1 while $vendorstats{$vendorid."_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
889 print "<td class='base' colspan=2 align='right'>";
890 printf "%15s", $vendorstats{$vendorid."_filesize"};
891 print " </td>\n";
893 unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; }
894 1 while $vendorstats{$vendorid."_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
895 print "<td class='base' colspan=2 align='right'>";
896 printf "%15s", $vendorstats{$vendorid."_cachehits"};
897 print " </td>\n";
899 print "<td class='base' colspan=2 align='right'>";
900 printf "%5d", $vendorstats{$vendorid."_1"};
901 print " </td>\n";
903 print "<td class='base' colspan=2 align='right'>";
904 printf "%5d", $vendorstats{$vendorid."_3"};
905 print " </td>\n";
907 print "<td class='base' colspan=2 align='right'>";
908 printf "%5d", $vendorstats{$vendorid."_2"};
909 print " </td>\n";
911 print "<td class='base' colspan=2 align='right'>";
912 printf "%5d", $vendorstats{$vendorid."_0"};
913 print " </td>\n";
915 print "<td class='base'> </td>\n";
925 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
926 <td class='base'> </td>
927 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
928 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
929 <td class='base'> </td>
930 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
931 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
932 <td class='base'> </td>
933 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
934 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
935 <td class='base'> </td>
936 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
937 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
938 <td class='base'> </td>
950 # =====================================================================================
952 # =====================================================================================
954 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance')
958 # ----------------------------------------------------
960 # ----------------------------------------------------
962 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}");
964 @sources= <$repository/download/*>;
966 undef @repositoryfiles;
971 @updatelist = <$_/*>;
972 $vendorid = substr($_,rindex($_,"/")+1);
976 $updatefile = substr($_,rindex($_,"/")+1);
977 $_ = $updatefile; tr/[A-Z]/[a-z]/;
978 $updatefile = "$_:separator:download/$vendorid/$updatefile";
979 $updatefile = " ".$updatefile;
980 push(@repositoryfiles,$updatefile);
986 foreach (<$repository/*>)
990 unless (/^$repository\/download
$/) { push(@sources,$_); }
997 $vendorid = substr($_,rindex($_,"/")+1);
1000 $uuid = substr($_,rindex($_,"/")+1);
1001 if (-e
"$_/source.url")
1003 open (FILE
,"$_/source.url");
1007 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
1008 $_ = $updatefile; tr/[A-Z]/[a-z]/;
1009 $updatefile = "$_:separator:$vendorid/$uuid/$updatefile";
1010 push(@repositoryfiles,$updatefile);
1015 @repositoryfiles = sort(@repositoryfiles);
1017 unless (@repositoryfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
1022 <td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
1025 <table width='75%' cellspacing='5'>
1027 <td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
1028 <td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
1029 <td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
1030 <td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
1032 <td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
1037 open(DF
,"/bin/df -h $repository|");
1042 $dfstr = join(' ',@dfdata);
1043 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
1047 <td align='center'>[$repository]</td>
1048 <td align='center'>$size</td>
1049 <td align='center'>$used</td>
1050 <td align='center'>$free</td>
1051 <td align='right' colspan='2'>
1054 &percentbar
($percent);
1057 <td align='center'>$percent</td>
1063 if (@repositoryfiles)
1067 <form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>
1068 <table width='100%'>
1070 <td class='base' colspan='3'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr purge'}' /> $Lang::tr{'updxlrtr all files'}</td>
1071 <td class='base' width='25%'>
1072 <input type='checkbox' name='REMOVE_OBSOLETE' $checked{'REMOVE_OBSOLETE'}{'on'} /> $Lang::tr{'updxlrtr not accessed'}
1074 <td class='base' colspan='3'>
1075 <select name='NOT_ACCESSED_LAST'>
1076 <option value='week' $selected{'NOT_ACCESSED_LAST'}{'week'}>$Lang::tr{'updxlrtr week'}</option>
1077 <option value='month1' $selected{'NOT_ACCESSED_LAST'}{'month1'}>$Lang::tr{'updxlrtr month'}</option>
1078 <option value='month3' $selected{'NOT_ACCESSED_LAST'}{'month3'}>$Lang::tr{'updxlrtr 3 months'}</option>
1079 <option value='month6' $selected{'NOT_ACCESSED_LAST'}{'month6'}>$Lang::tr{'updxlrtr 6 months'}</option>
1080 <option value='year' $selected{'NOT_ACCESSED_LAST'}{'year'}>$Lang::tr{'updxlrtr year'}</option>
1087 <td class='base' width='25%'>
1088 <input type='checkbox' name='REMOVE_NOSOURCE' $checked{'REMOVE_NOSOURCE'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1090 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1091 <td class='base' width='17%'>[<i>$Lang::tr{'updxlrtr condition nosource'}</i>]</td>
1092 <td class='base' width='25%'>
1093 <input type='checkbox' name='REMOVE_OUTDATED' $checked{'REMOVE_OUTDATED'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1095 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1096 <td class='base' width='27%'>[<i>$Lang::tr{'updxlrtr condition outdated'}</i>]</td>
1104 &printcurrentfiles
($Lang::tr
{'updxlrtr current files'}, @repositoryfiles);
1105 print "<br>\n<table>\n";
1106 &printlegendicons
();
1107 &printlegendspacer
();
1108 &printlegendstatus
();
1109 &printlegendspacer
();
1110 &printlegendsource
();
1114 &Header
::closebox
();
1118 # =====================================================================================
1120 &Header
::closebigbox
();
1122 &Header
::closepage
();
1124 # -------------------------------------------------------------------
1126 sub printcurrentfiles
1133 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current files'}</b></td></tr>
1135 <table width='100%'>
1136 <colgroup span='2' width='2%'></colgroup>
1137 <colgroup span='1' width='0*'></colgroup>
1138 <colgroup span='4' width='5%'></colgroup>
1139 <colgroup span='1' width='2%'></colgroup>
1141 <td class='base' align='center'> </td>
1142 <td class='base' align='center'> </td>
1143 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
1144 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
1145 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
1146 <td class='base' align='center'><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1147 <td class='base' align='center'><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1148 <td class='base' align='center'> </td>
1153 foreach $updatefile (@files)
1155 $updatefile =~ s/.*:separator://;
1156 my $size_updatefile = 0;
1158 if(-e
"$repository/$updatefile") {
1159 $size_updatefile = (-s
"$repository/$updatefile");
1160 $mtime = &getmtime
("$repository/$updatefile");
1165 print "<tr bgcolor='$Header::table1colour'>\n"; }
1167 print "<tr bgcolor='$Header::table2colour'>\n"; }
1169 $filesize = $size_updatefile;
1170 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
1172 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
1173 $DAYdt = sprintf ("%.02d",$DAYdt);
1174 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1175 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1176 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
1178 $lastaccess = "n/a";
1181 $status = $sfUnknown;
1183 unless ($updatefile =~ /^download\//)
1185 ($vendorid,$uuid,$shortname) = split('/',$updatefile);
1187 if (-e
"$repository/$vendorid/$uuid/access.log")
1189 open (FILE
,"$repository/$vendorid/$uuid/access.log");
1194 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1195 $DAYdt = sprintf ("%.02d",$DAYdt);
1196 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1197 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1198 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1200 if (-e
"$repository/$vendorid/$uuid/checkup.log")
1202 open (FILE
,"$repository/$vendorid/$uuid/checkup.log");
1207 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1208 $DAYdt = sprintf ("%.02d",$DAYdt);
1209 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1210 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1211 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1213 if (-e
"$repository/$vendorid/$uuid/status")
1215 open (FILE
,"$repository/$vendorid/$uuid/status");
1219 $status = $metadata[-1];
1222 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
1223 $status = $sfOutdated;
1226 print "\t\t<td align='center' nowrap='nowrap'> ";
1227 if ($status == $sfUnknown)
1229 print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /> </td>\n";
1231 if ($status == $sfOk)
1233 print "<img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /> </td>\n";
1235 if ($status == $sfNoSource)
1237 print "<img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /> </td>\n";
1239 if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i
)))
1241 print "<img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /> </td>\n";
1243 if (($status == $sfOutdated) && ($updatefile =~ /^download\//i
))
1245 print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
1248 print "\t\t<td align='center' nowrap='nowrap'> ";
1249 if ($vendorid =~ /^Adobe$/i)
1251 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
1252 } elsif ($vendorid =~ /^Microsoft$/i)
1254 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
1255 } elsif ($vendorid =~ /^Symantec$/i)
1257 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
1258 } elsif ($vendorid =~ /^Linux$/i)
1260 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
1261 } elsif ($vendorid =~ /^TrendMicro$/i)
1263 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
1264 } elsif ($vendorid =~ /^Apple$/i)
1266 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
1267 } elsif ($vendorid =~ /^Avast$/i)
1269 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
1270 } elsif ($vendorid =~ /^Avira$/i)
1272 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
1273 } elsif ($vendorid =~ /^AVG$/i)
1275 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
1276 } elsif ($vendorid =~ /^Ipfire$/i)
1278 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
1282 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
1284 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1286 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1290 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
1291 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
1294 <td class='base' align='left' title='cache:/$updatefile'><a href="/updatecache/$updatefile">$shortname</a></td>
1295 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
1296 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
1297 <td class='base' align='center' nowrap='nowrap'> $lastaccess </td>
1298 <td class='base' align='center' nowrap='nowrap'> $lastcheck </td>
1300 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
1301 <input type='image' name='$Lang::tr{'updxlrtr remove file'}' src='/images/delete.gif' title='$Lang::tr{'updxlrtr remove file'}' alt='$Lang::tr{'updxlrtr remove file'}' />
1302 <input type='hidden' name='ID' value='$updatefile' />
1303 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr remove file'}' />
1315 # -------------------------------------------------------------------
1317 sub printlegenddownload
1321 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1322 <td class='base'> </td>
1323 <td><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1324 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1325 <td class='base'> </td>
1326 <td class='base'> </td>
1327 <td><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /></td>
1328 <td class='base'>$Lang::tr{'updxlrtr condition suspended'}</td>
1329 <td class='base'> </td>
1330 <td class='base'> </td>
1331 <td><img src='/images/delete.gif' alt='$Lang::tr{'updxlrtr cancel download'}' /></td>
1332 <td class='base'>$Lang::tr{'updxlrtr cancel download'}</td>
1338 # -------------------------------------------------------------------
1340 sub printlegendicons
1347 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1348 <td class='base'> </td>
1349 <td><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1350 <td class='base'>$Lang::tr{'updxlrtr last access'}</td>
1351 <td class='base'> </td>
1352 <td><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1353 <td class='base'>$Lang::tr{'updxlrtr last checkup'}</td>
1354 <td class='base'> </td>
1355 <td><img src='/images/delete.gif' alt='$Lang::tr{'updxlrtr remove file'}' /></td>
1356 <td class='base'>$Lang::tr{'updxlrtr remove file'}</td>
1357 <td class='base'> </td>
1358 <td class='base'> </td>
1359 <td class='base'> </td>
1365 # -------------------------------------------------------------------
1367 sub printlegendstatus
1371 <td class='base'> $Lang::tr{'status'}:</td>
1372 <td class='base'> </td>
1373 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
1374 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
1375 <td class='base'> </td>
1376 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1377 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
1378 <td class='base'> </td>
1379 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1380 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
1381 <td class='base'> </td>
1382 <td class='base'> </td>
1384 <td class='base'> </td>
1387 <td class='base'> </td>
1388 <td class='base'> </td>
1389 <td align='center'><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1390 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1391 <td class='base'> </td>
1392 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
1393 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
1394 <td class='base'> </td>
1395 <td class='base'> </td>
1396 <td class='base'> </td>
1397 <td class='base'> </td>
1398 <td class='base'> </td>
1400 <td class='base'> </td>
1406 # -------------------------------------------------------------------
1408 sub printlegendsource
1415 <td class='base'> $Lang::tr{'updxlrtr source'}:</td>
1416 <td class='base'> </td>
1417 <td align='center'><img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe' /></td>
1418 <td class='base'>Adobe</td>
1419 <td class='base'> </td>
1420 <td align='center'><img src='/images/updbooster/updxl-src-apple.gif' alt='Apple' /></td>
1421 <td class='base'>Apple</td>
1422 <td class='base'> </td>
1423 <td align='center'><img src='/images/updbooster/updxl-src-avast.gif' alt='Avast' /></td>
1424 <td class='base'>Avast</td>
1425 <td class='base'> </td>
1426 <td align='center'><img src='/images/updbooster/updxl-src-linux.gif' alt='Linux' /></td>
1427 <td class='base'>Linux</td>
1430 <td colspan='13'></td>
1433 <td class='base'> </td>
1434 <td class='base'> </td>
1435 <td align='center'><img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft' /></td>
1436 <td class='base'>Microsoft</td>
1437 <td class='base'> </td>
1438 <td align='center'><img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec' /></td>
1439 <td class='base'>Symantec</td>
1440 <td class='base'> </td>
1441 <td align='center'><img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro' /></td>
1442 <td class='base'>Trend Micro</td>
1443 <td class='base'> </td>
1444 <td align='center'><img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /></td>
1445 <td class='base'>IPFire</td>
1448 <td class='base'> </td>
1449 <td class='base'> </td>
1450 <td align='center'><img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /></td>
1451 <td class='base'>Avira</td>
1452 <td class='base'> </td>
1453 <td align='center'><img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /></td>
1454 <td class='base'>AVG</td>
1455 <td class='base'> </td>
1456 <td align='center'><img src='/images/updbooster/updxl-src-unknown.gif' alt='$Lang::tr{'updxlrtr other'}' /></td>
1457 <td class='base'>$Lang::tr{'updxlrtr other'}</td>
1458 <td class='base'> </td>
1459 <td align='center'></td>
1460 <td class='base'> </td>
1468 # -------------------------------------------------------------------
1470 sub printlegendspacer
1474 <td colspan='13'> <br></td>
1480 # -------------------------------------------------------------------
1485 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily'))
1487 &General
::system('/usr/local/bin/updxlratorctrl', 'cron', 'daily');
1489 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
1491 &General
::system('/usr/local/bin/updxlratorctrl', 'cron', 'weekly');
1493 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
1495 &General
::system('/usr/local/bin/updxlratorctrl', 'cron', 'monthly');
1498 # don't save those variable to the settings file,
1499 # but we wan't to have them in the hash again after saving to file
1500 my $obsolete = $xlratorsettings{'REMOVE_OBSOLETE'};
1501 my $nosource = $xlratorsettings{'REMOVE_NOSOURCE'};
1502 my $outdated = $xlratorsettings{'REMOVE_OUTDATED'};
1503 my $gui = $xlratorsettings{'EXTENDED_GUI'};
1505 delete($xlratorsettings{'REMOVE_OBSOLETE'});
1506 delete($xlratorsettings{'REMOVE_NOSOURCE'});
1507 delete($xlratorsettings{'REMOVE_OUTDATED'});
1509 delete($xlratorsettings{'EXTENDED_GUI'});
1511 &General
::writehash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
1513 # put temp variables back into the hash
1514 $xlratorsettings{'REMOVE_OBSOLETE'} = $obsolete;
1515 $xlratorsettings{'REMOVE_NOSOURCE'} = $nosource;
1516 $xlratorsettings{'REMOVE_OUTDATED'} = $outdated;
1517 $xlratorsettings{'EXTENDED_GUI'} = $gui;
1520 # -------------------------------------------------------------------
1524 my $percent = $_[0];
1528 if ($percent =~ m/^(\d+)%$/ )
1531 <table width='100' border='1' cellspacing='0' cellpadding='0' style='border-width:1px;border-style:solid;border-color:$fg;width:100px;height:10px;'>
1535 if ($percent eq "100%") {
1536 print "<td width='100%' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'>"
1537 } elsif ($percent eq "0%") {
1538 print "<td width='100%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
1540 print "<td width='$percent' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'></td><td width='" . (100-$1) . "%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
1543 <img src='/images/null.gif' width='1' height='1' alt='' /></td></tr></table>
1549 # -------------------------------------------------------------------
1553 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]);
1558 # -------------------------------------------------------------------
1563 my @psdata=`ps ax --no-heading`;
1567 if (/$_[0]/) { ($pid)=/^\s*(\d+)/; }
1573 # -------------------------------------------------------------------