]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/updatexlrator.cgi
4 # This code is distributed under the terms of the GPL
6 # (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net
8 # Portions (c) 2008 by dotzball - http://www.blockouttraffic.de
10 # $Id: updatexlrator.cgi,v 2.1.0 2008/07/16 00:00:00 marco.s Exp $
12 ###############################################################################
14 # IPFire.org - A linux based firewall #
15 # Copyright (C) 2009 Michael Tremer & Christian Schmidt #
17 # This program is free software: you can redistribute it and/or modify #
18 # it under the terms of the GNU General Public License as published by #
19 # the Free Software Foundation, either version 3 of the License, or #
20 # (at your option) any later version. #
22 # This program is distributed in the hope that it will be useful, #
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
25 # GNU General Public License for more details. #
27 # You should have received a copy of the GNU General Public License #
28 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
30 ###############################################################################
34 # enable only the following on debugging purpose
35 #use warnings; no warnings 'once';# 'redefine', 'uninitialized';
36 #use CGI::Carp 'fatalsToBrowser';
40 require '/var/ipfire/general-functions.pl';
41 require "${General::swroot}/lang.pl";
42 require "${General::swroot}/header.pl";
50 my %xlratorsettings=();
78 my $repository = "/var/updatecache/";
79 my $hintcolour = '#FFFFCC';
80 my $colourgray = '#808080';
87 my $not_accessed_last='';
91 my @repositorylist=();
92 my @repositoryfiles=();
98 my $chk_cron_dly = "${General::swroot}/updatexlrator/autocheck/cron.daily";
99 my $chk_cron_wly = "${General::swroot}/updatexlrator/autocheck/cron.weekly";
100 my $chk_cron_mly = "${General::swroot}/updatexlrator/autocheck/cron.monthly";
102 &General
::readhash
("${General::swroot}/ethernet/settings", \
%netsettings);
103 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
104 &General
::readhash
("${General::swroot}/proxy/settings", \
%proxysettings);
105 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
107 $xlratorsettings{'ACTION'} = '';
108 $xlratorsettings{'ENABLE_LOG'} = 'off';
109 $xlratorsettings{'PASSIVE_MODE'} = 'off';
110 $xlratorsettings{'MAX_DISK_USAGE'} = '75';
111 $xlratorsettings{'LOW_DOWNLOAD_PRIORITY'} = 'off';
112 $xlratorsettings{'MAX_DOWNLOAD_RATE'} = '';
113 $xlratorsettings{'ENABLE_AUTOCHECK'} = 'off';
114 $xlratorsettings{'FULL_AUTOSYNC'} = 'off';
115 $xlratorsettings{'NOT_ACCESSED_LAST'} = 'month1';
116 $xlratorsettings{'REMOVE_NOSOURCE'} = 'off';
117 $xlratorsettings{'REMOVE_OUTDATED'} = 'off';
118 $xlratorsettings{'REMOVE_OBSOLETE'} = 'off';
120 &Header
::getcgihash
(\
%xlratorsettings);
122 $xlratorsettings{'EXTENDED_GUI'} = '';
124 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>")
126 $xlratorsettings{'EXTENDED_GUI'} = 'statistics';
129 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>")
131 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
134 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr purge'})
136 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
138 if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on'))
141 undef @repositoryfiles;
142 foreach (<$repository/*>)
146 unless (/^$repository\/download
$/) { push(@sources,$_); }
153 $vendorid = substr($_,rindex($_,"/")+1);
156 $uuid = substr($_,rindex($_,"/")+1);
157 if (-e
"$_/source.url")
159 open (FILE
,"$_/source.url");
163 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
164 $updatefile = "$vendorid/$uuid/$updatefile";
165 push(@repositoryfiles,$updatefile);
170 foreach (@repositoryfiles)
172 ($vendorid,$uuid,$updatefile) = split('/');
174 if (-e
"$repository/$vendorid/$uuid/status")
176 open (FILE
,"$repository/$vendorid/$uuid/status");
180 $status = $metadata[-1];
183 if (-e
"$repository/$vendorid/$uuid/access.log")
185 open (FILE
,"$repository/$vendorid/$uuid/access.log");
189 $lastaccess = $metadata[-1];
192 if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource))
194 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
196 if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated))
198 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
200 if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on')
202 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800)))
204 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
206 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600)))
208 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
210 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800)))
212 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
214 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600)))
216 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
218 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000)))
220 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
227 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'save'})
229 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
231 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
234 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
236 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
243 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr save and restart'})
245 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
247 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
250 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
252 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
255 if ((!(-e
"${General::swroot}/proxy/enable")) && (!(-e
"${General::swroot}/proxy/enable_blue")))
257 $errormessage = $Lang::tr
{'updxlrtr web proxy service required'};
260 if (!($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on'))
262 $errormessage = $Lang::tr
{'updxlrtr not enabled'};
268 system('/usr/local/bin/squidctrl restart >/dev/null 2>&1');
271 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'})
273 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
275 $updatefile = $xlratorsettings{'ID'};
277 unless ($updatefile =~ /^download\//)
279 ($vendorid,$uuid,$updatefile) = split('/',$updatefile);
280 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
284 if (($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr cancel download'}) || ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'}))
286 $updatefile = $xlratorsettings{'ID'};
288 if ($updatefile =~ /^download\//)
290 ($uuid,$vendorid,$updatefile) = split('/',$updatefile);
292 if (-e
"$repository/download/$vendorid/$updatefile.info")
294 &General
::readhash
("$repository/download/$vendorid/$updatefile.info", \
%dlinfo);
296 $id = &getPID
("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$");
297 if ($id) { system("/bin/kill -9 $id"); }
298 $id = &getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$");
299 if ($id) { system("/bin/kill -9 $id"); }
301 system("rm $repository/download/$vendorid/$updatefile.info");
304 if (-e
"$repository/download/$vendorid/$updatefile")
306 system("rm $repository/download/$vendorid/$updatefile");
312 $not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'};
313 undef($xlratorsettings{'NOT_ACCESSED_LAST'});
315 if (-e
"${General::swroot}/updatexlrator/settings")
317 &General
::readhash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
320 if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '')
322 $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last;
327 $checked{'ENABLE_LOG'}{'off'} = '';
328 $checked{'ENABLE_LOG'}{'on'} = '';
329 $checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} = "checked='checked'";
330 $checked{'PASSIVE_MODE'}{'off'} = '';
331 $checked{'PASSIVE_MODE'}{'on'} = '';
332 $checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} = "checked='checked'";
333 $checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} = '';
334 $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} = '';
335 $checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}} = "checked='checked'";
336 $checked{'ENABLE_AUTOCHECK'}{'off'} = '';
337 $checked{'ENABLE_AUTOCHECK'}{'on'} = '';
338 $checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} = "checked='checked'";
339 $checked{'FULL_AUTOSYNC'}{'off'} = '';
340 $checked{'FULL_AUTOSYNC'}{'on'} = '';
341 $checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} = "checked='checked'";
342 $checked{'REMOVE_NOSOURCE'}{'off'} = '';
343 $checked{'REMOVE_NOSOURCE'}{'on'} = '';
344 $checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} = "checked='checked'";
345 $checked{'REMOVE_OUTDATED'}{'off'} = '';
346 $checked{'REMOVE_OUTDATED'}{'on'} = '';
347 $checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} = "checked='checked'";
348 $checked{'REMOVE_OBSOLETE'}{'off'} = '';
349 $checked{'REMOVE_OBSOLETE'}{'on'} = '';
350 $checked{'REMOVE_OBSOLETE'}{$xlratorsettings{'REMOVE_OBSOLETE'}} = "checked='checked'";
353 $selected{'AUTOCHECK_SCHEDULE'}{'daily'} = '';
354 $selected{'AUTOCHECK_SCHEDULE'}{'weekly'} = '';
355 $selected{'AUTOCHECK_SCHEDULE'}{'monthly'} = '';
356 $selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = "selected='selected'";
358 $selected{'NOT_ACCESSED_LAST'}{'week'} = '';
359 $selected{'NOT_ACCESSED_LAST'}{'month1'} = '';
360 $selected{'NOT_ACCESSED_LAST'}{'month3'} = '';
361 $selected{'NOT_ACCESSED_LAST'}{'month6'} = '';
362 $selected{'NOT_ACCESSED_LAST'}{'year'} = '';
363 $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selected='selected'";
365 # ----------------------------------------------------
367 # ----------------------------------------------------
369 &Header
::showhttpheaders
();
371 &Header
::openpage
($Lang::tr
{'updxlrtr configuration'}, 1, '');
373 &Header
::openbigbox
('100%', 'left', '', $errormessage);
376 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
377 print "<font class='base'>$errormessage </font>\n";
381 print "<form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>\n";
383 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr update accelerator'}");
388 <td colspan='4'><b>$Lang::tr{'updxlrtr common settings'}</b></td>
391 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable log'}:</td>
392 <td class='base' width='20%'><input type='checkbox' name='ENABLE_LOG' $checked{'ENABLE_LOG'}{'on'} /></td>
393 <td class='base' width='25%'></td>
394 <td class='base' width='30%'></td>
397 <td class='base'>$Lang::tr{'updxlrtr passive mode'}:</td>
398 <td class='base'><input type='checkbox' name='PASSIVE_MODE' $checked{'PASSIVE_MODE'}{'on'} /></td>
399 <td class='base'>$Lang::tr{'updxlrtr max disk usage'}:</td>
400 <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='1' /> %</td>
406 <td colspan='4'><b>$Lang::tr{'updxlrtr performance options'}</b></td>
409 <td class='base' width='25%'>$Lang::tr{'updxlrtr low download priority'}:</td>
410 <td class='base' width='20%'><input type='checkbox' name='LOW_DOWNLOAD_PRIORITY' $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} /></td>
411 <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}: <img src='/blob.gif' alt='*' </td>
412 <td class='base' width='30%'><input type='text' name='MAX_DOWNLOAD_RATE' value='$xlratorsettings{'MAX_DOWNLOAD_RATE'}' size='5' /></td>
418 <td colspan='4'><b>$Lang::tr{'updxlrtr source checkup'}</b></td>
421 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable autocheck'}:</td>
422 <td class='base' width='20%'><input type='checkbox' name='ENABLE_AUTOCHECK' $checked{'ENABLE_AUTOCHECK'}{'on'} /></td>
423 <td class='base' width='25%'>$Lang::tr{'updxlrtr source checkup schedule'}:</td>
424 <td class='base' width='30%'>
425 <select name='AUTOCHECK_SCHEDULE'>
426 <option value='daily' $selected{'AUTOCHECK_SCHEDULE'}{'daily'}>$Lang::tr{'updxlrtr daily'}</option>
427 <option value='weekly' $selected{'AUTOCHECK_SCHEDULE'}{'weekly'}>$Lang::tr{'updxlrtr weekly'}</option>
428 <option value='monthly' $selected{'AUTOCHECK_SCHEDULE'}{'monthly'}>$Lang::tr{'updxlrtr monthly'}</option>
433 <td class='base'>$Lang::tr{'updxlrtr full autosync'}:</td>
434 <td class='base'><input type='checkbox' name='FULL_AUTOSYNC' $checked{'FULL_AUTOSYNC'}{'on'} /></td>
442 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
443 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr save and restart'}' /></td>
448 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr statistics'}";
449 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') { print " <<' "; } else { print " >>' "; }
452 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr maintenance'}";
453 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') { print " <<' "; } else { print " >>' "; }
466 # ----------------------------------------------------
467 # List pending downloads - if any
468 # ----------------------------------------------------
470 if (($xlratorsettings{'EXTENDED_GUI'} ne 'statistics') && ($xlratorsettings{'EXTENDED_GUI'} ne 'maintenance'))
472 @downloadlist = <$repository/download/*>;
474 undef(@downloadfiles);
475 foreach (@downloadlist)
479 my @filelist = <$_/*>;
480 $vendorid = substr($_,rindex($_,"/")+1);
484 $updatefile = substr($_,rindex($_,"/")+1);
485 $updatefile .= ":download/$vendorid/$updatefile";
486 $updatefile = " ".$updatefile;
487 push(@downloadfiles, $updatefile);
494 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr pending downloads'}");
498 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current downloads'}</b></td></tr>
501 <colgroup span='3' width='2%'></colgroup>
502 <colgroup span='1' width='0*'></colgroup>
503 <colgroup span='3' width='5%'></colgroup>
504 <colgroup span='1' width='2%'></colgroup>
506 <td class='base' align='center'> </td>
507 <td class='base' align='left' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
508 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
509 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
510 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
511 <td class='base' align='center'><i>$Lang::tr{'updxlrtr progress'}</i></td>
512 <td class='base' align='center'> </td>
517 foreach $updatefile (@downloadfiles)
519 $updatefile =~ s/.*://;
520 my $size_updatefile = 0;
522 if(-e
"$repository/$updatefile") {
523 $size_updatefile = (-s
"$repository/$updatefile");
524 $mtime = &getmtime
("$repository/$updatefile");
526 if (-e
"$repository/$updatefile.info") {
527 &General
::readhash
("$repository/$updatefile.info", \
%dlinfo);
534 print "<tr bgcolor='$Header::table1colour'>\n"; }
536 print "<tr bgcolor='$Header::table2colour'>\n"; }
538 $filesize = $size_updatefile;
539 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
541 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
542 $DAYdt = sprintf ("%.02d",$DAYdt);
543 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
544 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
545 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
547 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
549 print "\t\t<td align='center' nowrap='nowrap'> ";
550 if (&getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"))
552 print "<img src='/images/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
554 print "<img src='/images/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /> </td>\n";
557 print "\t\t<td align='center' nowrap='nowrap'> ";
558 if ($vendorid =~ /^Adobe$/i)
560 print "<img src='/images/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
561 } elsif ($vendorid =~ /^Microsoft$/i)
563 print "<img src='/images/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
564 } elsif ($vendorid =~ /^Symantec$/i)
566 print "<img src='/images/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
567 } elsif ($vendorid =~ /^Linux$/i)
569 print "<img src='/images/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
570 } elsif ($vendorid =~ /^TrendMicro$/i)
572 print "<img src='/images/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
573 } elsif ($vendorid =~ /^Apple$/i)
575 print "<img src='/images/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
576 } elsif ($vendorid =~ /^Avast$/i)
578 print "<img src='/images/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
581 if (-e
"/home/httpd/html/images/updxl-src-" . $vendorid . ".gif")
583 print "<img src='/images/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
585 print "<img src='/images/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
589 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
590 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
592 $filesize = $dlinfo{'REMOTESIZE'};
593 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
594 $dlinfo{'VENDORID'}=ucfirst $vendorid;
597 <td class='base' align='center'> $dlinfo{'VENDORID'} </td>
598 <td class='base' align='left' title='cache:/$updatefile'>$shortname</td>
599 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
600 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
601 <td class='base' align='center' nowrap='nowrap'>
605 if ($dlinfo{'REMOTESIZE'} && $size_updatefile)
607 $percent=int(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile))."%";
609 print $percent; &percentbar
($percent);
613 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
614 <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'}' />
615 <input type='hidden' name='ID' value='$updatefile' />
616 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr cancel download'}' />
624 print "</table>\n<br>\n<table>\n";
625 &printlegenddownload
();
631 # =====================================================================================
633 # =====================================================================================
635 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics')
638 # ----------------------------------------------------
640 # ----------------------------------------------------
643 foreach (<$repository/*>)
647 unless ((/^$repository\/download
$/) || (/^$repository\
/lost\+found$/)) { push(@sources,$_); }
654 $vendorid=substr($_,rindex($_,'/')+1,length($_));
655 push(@vendors,$vendorid);
656 $vendorstats{$vendorid."_filesize"} = 0;
657 $vendorstats{$vendorid."_requests"} = 0;
658 $vendorstats{$vendorid."_files"} = 0;
659 $vendorstats{$vendorid."_cachehits"} = 0;
660 $vendorstats{$vendorid."_0"} = 0;
661 $vendorstats{$vendorid."_1"} = 0;
662 $vendorstats{$vendorid."_2"} = 0;
663 $vendorstats{$vendorid."_3"} = 0;
665 foreach $data (@updatelist)
667 if (-e
"$data/source.url")
669 open (FILE
,"$data/source.url");
673 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
675 my $size_updatefile = 0;
676 if(-e
"$data/$updatefile") {
677 $size_updatefile = (-s
"$data/$updatefile");
682 #die "file not found: $data/$updatefile\n";
687 $filesize += $size_updatefile;
689 # File size for this source
691 $vendorstats{$vendorid."_filesize"} += $size_updatefile;
693 # Number of requests from cache for this source
695 open (FILE
,"$data/access.log");
701 $vendorstats{$vendorid."_requests"} += $counts;
702 $cachehits += $counts;
704 # Total number of files in cache
708 # Number of files for this source
710 $vendorstats{$vendorid."_files"}++;
712 # Count cache status occurences
714 open (FILE
,"$data/status");
718 $vendorstats{$vendorid."_".$_}++;
720 # Calculate cached traffic for this source
722 $vendorstats{$vendorid."_cachehits"} += $counts * $size_updatefile;
724 # Calculate total cached traffic
726 $cachedtraffic += $counts * $size_updatefile;
732 if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); }
734 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
735 1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/;
737 # ----------------------------------------------------
739 # ----------------------------------------------------
741 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}");
743 unless ($numfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
747 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
749 <table cellpadding='3'>
751 <td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
752 <td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
753 <td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
754 <td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
755 <td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
760 open(DF
,"/bin/df -h $repository|");
765 $dfstr = join(' ',@dfdata);
766 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
770 <td>[$repository]</td>
771 <td align='right'>$size</td>
772 <td align='right'>$used</td>
773 <td align='right'>$free</td>
777 &percentbar
($percent);
780 <td align='right'>$percent</td>
792 <td colspan='5'><b>$Lang::tr{'updxlrtr summary'}</b></td>
795 <td class='base' width='25%'>$Lang::tr{'updxlrtr total files'}:</td>
796 <td class='base' width='20%'><font color='$colourgray'>$numfiles</font></td>
797 <td class='base' width='25%'>$Lang::tr{'updxlrtr total cache size'}:</td>
798 <td class='base' width='15%' align='right'><font color='$colourgray'>$filesize</font></td>
799 <td class='base'></td>
802 <td class='base'>$Lang::tr{'updxlrtr efficiency index'}:</td>
803 <td class='base'><font color='$colourgray'>$efficiency</font></td>
804 <td class='base'>$Lang::tr{'updxlrtr total data from cache'}:</td>
805 <td class='base' align='right'><font color='$colourgray'>$cachedtraffic</font></td>
806 <td class='base'></td>
812 <td colspan='17'><b>$Lang::tr{'updxlrtr statistics by source'}</b></td>
815 <td class='base' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
816 <td class='base' width='7%'> </td>
817 <td class='base' align='right'><i>$Lang::tr{'updxlrtr files'}</i></td>
818 <td class='base' width='7%'> </td>
819 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr cache size'}</i></nobr></td>
820 <td class='base' width='7%'> </td>
821 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr data from cache'}</i></nobr></td>
822 <td class='base' width='15%'> </td>
823 <td class='base'><img src="/images/updbooster/updxl-led-green.gif" /></td>
824 <td class='base' width='15%'> </td>
825 <td class='base'><img src="/images/updbooster/updxl-led-yellow.gif" /></td>
826 <td class='base' width='15%'> </td>
827 <td class='base'><img src="/images/updbooster/updxl-led-red.gif" /></td>
828 <td class='base' width='15%'> </td>
829 <td class='base'><img src="/images/updbooster/updxl-led-gray.gif" /></td>
830 <td class='base' width='90%'> </td>
841 unless ($vendorstats{$vendorid . "_files"}) { next; }
845 print "<tr bgcolor=''$color{'color20'}'>\n"; }
847 print "<tr bgcolor=''$color{'color22'}'>\n"; }
849 print "<td class='base' align='center'><nobr> ";
851 if ($vendorid =~ /^Adobe$/i)
853 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </nobr></td>\n";
854 print "<td class='base'> Adobe </td>\n";
855 } elsif ($vendorid =~ /^Microsoft$/i)
857 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </nobr></td>\n";
858 print "<td class='base'> Microsoft </td>\n";
859 } elsif ($vendorid =~ /^Symantec$/i)
861 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </nobr></td>\n";
862 print "<td class='base'> Symantec </td>\n";
863 } elsif ($vendorid =~ /^Linux$/i)
865 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </nobr></td>\n";
866 print "<td class='base'> Linux </td>\n";
867 } elsif ($vendorid =~ /^TrendMicro$/i)
869 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </nobr></td>\n";
870 print "<td class='base'> Trend Micro </td>\n";
871 } elsif ($vendorid =~ /^Apple$/i)
873 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </nobr></td>\n";
874 print "<td class='base'> Apple </td>\n";
875 } elsif ($vendorid =~ /^Avast$/i)
877 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </nobr></td>\n";
878 print "<td class='base'> Avast </td>\n";
879 } elsif ($vendorid =~ /^Avira$/i)
881 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
882 print "<td class='base'> Avira </td>\n";
883 } elsif ($vendorid =~ /^AVG$/i)
885 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
886 print "<td class='base'> AVG </td>\n";
887 } elsif ($vendorid =~ /^Ipfire$/i)
889 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
890 print "<td class='base'> IPFire </td>\n";
893 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
895 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
897 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
899 print "<td class='base'> " . ucfirst $vendorid . " </td>\n";
902 print "<td class='base' colspan=2 align='right'>";
903 printf "%5d", $vendorstats{$vendorid."_files"};
904 print " </td>\n";
906 unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; }
907 1 while $vendorstats{$vendorid."_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
908 print "<td class='base' colspan=2 align='right'>";
909 printf "%15s", $vendorstats{$vendorid."_filesize"};
910 print " </td>\n";
912 unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; }
913 1 while $vendorstats{$vendorid."_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
914 print "<td class='base' colspan=2 align='right'>";
915 printf "%15s", $vendorstats{$vendorid."_cachehits"};
916 print " </td>\n";
918 print "<td class='base' colspan=2 align='right'>";
919 printf "%5d", $vendorstats{$vendorid."_1"};
920 print " </td>\n";
922 print "<td class='base' colspan=2 align='right'>";
923 printf "%5d", $vendorstats{$vendorid."_3"};
924 print " </td>\n";
926 print "<td class='base' colspan=2 align='right'>";
927 printf "%5d", $vendorstats{$vendorid."_2"};
928 print " </td>\n";
930 print "<td class='base' colspan=2 align='right'>";
931 printf "%5d", $vendorstats{$vendorid."_0"};
932 print " </td>\n";
934 print "<td class='base'> </td>\n";
944 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
945 <td class='base'> </td>
946 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
947 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
948 <td class='base'> </td>
949 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
950 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
951 <td class='base'> </td>
952 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
953 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
954 <td class='base'> </td>
955 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
956 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
957 <td class='base'> </td>
969 # =====================================================================================
971 # =====================================================================================
973 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance')
977 # ----------------------------------------------------
979 # ----------------------------------------------------
981 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}");
983 @sources= <$repository/download/*>;
985 undef @repositoryfiles;
990 @updatelist = <$_/*>;
991 $vendorid = substr($_,rindex($_,"/")+1);
995 $updatefile = substr($_,rindex($_,"/")+1);
996 $updatefile .= ":download/$vendorid/$updatefile";
997 $updatefile = " ".$updatefile;
998 push(@repositoryfiles,$updatefile);
1004 foreach (<$repository/*>)
1008 unless (/^$repository\/download
$/) { push(@sources,$_); }
1015 $vendorid = substr($_,rindex($_,"/")+1);
1016 foreach(@updatelist)
1018 $uuid = substr($_,rindex($_,"/")+1);
1019 if (-e
"$_/source.url")
1021 open (FILE
,"$_/source.url");
1025 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
1026 $_ = $updatefile; tr/[A-Z]/[a-z]/;
1027 $updatefile = "$_:$vendorid/$uuid/$updatefile";
1028 push(@repositoryfiles,$updatefile);
1033 @repositoryfiles = sort(@repositoryfiles);
1035 unless (@repositoryfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
1039 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
1041 <table cellpadding='3'>
1043 <td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
1044 <td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
1045 <td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
1046 <td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
1047 <td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
1052 open(DF
,"/bin/df -h $repository|");
1057 $dfstr = join(' ',@dfdata);
1058 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
1062 <td>[$repository]</td>
1063 <td align='right'>$size</td>
1064 <td align='right'>$used</td>
1065 <td align='right'>$free</td>
1069 &percentbar
($percent);
1072 <td align='right'>$percent</td>
1078 if (@repositoryfiles)
1082 <form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>
1083 <table width='100%'>
1085 <td class='base' colspan='3'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr purge'}' /> $Lang::tr{'updxlrtr all files'}</td>
1086 <td class='base' width='25%'>
1087 <input type='checkbox' name='REMOVE_OBSOLETE' $checked{'REMOVE_OBSOLETE'}{'on'} /> $Lang::tr{'updxlrtr not accessed'}
1089 <td class='base' colspan='3'>
1090 <select name='NOT_ACCESSED_LAST'>
1091 <option value='week' $selected{'NOT_ACCESSED_LAST'}{'week'}>$Lang::tr{'updxlrtr week'}</option>
1092 <option value='month1' $selected{'NOT_ACCESSED_LAST'}{'month1'}>$Lang::tr{'updxlrtr month'}</option>
1093 <option value='month3' $selected{'NOT_ACCESSED_LAST'}{'month3'}>$Lang::tr{'updxlrtr 3 months'}</option>
1094 <option value='month6' $selected{'NOT_ACCESSED_LAST'}{'month6'}>$Lang::tr{'updxlrtr 6 months'}</option>
1095 <option value='year' $selected{'NOT_ACCESSED_LAST'}{'year'}>$Lang::tr{'updxlrtr year'}</option>
1102 <td class='base' width='25%'>
1103 <input type='checkbox' name='REMOVE_NOSOURCE' $checked{'REMOVE_NOSOURCE'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1105 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1106 <td class='base' width='17%'>[<i>$Lang::tr{'updxlrtr condition nosource'}</i>]</td>
1107 <td class='base' width='25%'>
1108 <input type='checkbox' name='REMOVE_OUTDATED' $checked{'REMOVE_OUTDATED'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1110 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1111 <td class='base' width='27%'>[<i>$Lang::tr{'updxlrtr condition outdated'}</i>]</td>
1119 &printcurrentfiles
($Lang::tr
{'updxlrtr current files'}, @repositoryfiles);
1120 print "<br>\n<table>\n";
1121 &printlegendicons
();
1122 &printlegendspacer
();
1123 &printlegendstatus
();
1124 &printlegendspacer
();
1125 &printlegendsource
();
1129 &Header
::closebox
();
1133 # =====================================================================================
1135 &Header
::closebigbox
();
1137 &Header
::closepage
();
1139 # -------------------------------------------------------------------
1141 sub printcurrentfiles
1148 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current files'}</b></td></tr>
1150 <table width='100%'>
1151 <colgroup span='2' width='2%'></colgroup>
1152 <colgroup span='1' width='0*'></colgroup>
1153 <colgroup span='4' width='5%'></colgroup>
1154 <colgroup span='1' width='2%'></colgroup>
1156 <td class='base' align='center'> </td>
1157 <td class='base' align='center'> </td>
1158 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
1159 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
1160 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
1161 <td class='base' align='center'><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1162 <td class='base' align='center'><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1163 <td class='base' align='center'> </td>
1168 foreach $updatefile (@files)
1170 $updatefile =~ s/.*://;
1171 my $size_updatefile = 0;
1173 if(-e
"$repository/$updatefile") {
1174 $size_updatefile = (-s
"$repository/$updatefile");
1175 $mtime = &getmtime
("$repository/$updatefile");
1180 print "<tr bgcolor='$Header::table1colour'>\n"; }
1182 print "<tr bgcolor='$Header::table2colour'>\n"; }
1184 $filesize = $size_updatefile;
1185 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
1187 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
1188 $DAYdt = sprintf ("%.02d",$DAYdt);
1189 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1190 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1191 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
1193 $lastaccess = "n/a";
1196 $status = $sfUnknown;
1198 unless ($updatefile =~ /^download\//)
1200 ($vendorid,$uuid,$shortname) = split('/',$updatefile);
1202 if (-e
"$repository/$vendorid/$uuid/access.log")
1204 open (FILE
,"$repository/$vendorid/$uuid/access.log");
1209 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1210 $DAYdt = sprintf ("%.02d",$DAYdt);
1211 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1212 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1213 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1215 if (-e
"$repository/$vendorid/$uuid/checkup.log")
1217 open (FILE
,"$repository/$vendorid/$uuid/checkup.log");
1222 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1223 $DAYdt = sprintf ("%.02d",$DAYdt);
1224 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1225 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1226 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1228 if (-e
"$repository/$vendorid/$uuid/status")
1230 open (FILE
,"$repository/$vendorid/$uuid/status");
1234 $status = $metadata[-1];
1237 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
1238 $status = $sfOutdated;
1241 print "\t\t<td align='center' nowrap='nowrap'> ";
1242 if ($status == $sfUnknown)
1244 print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /> </td>\n";
1246 if ($status == $sfOk)
1248 print "<img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /> </td>\n";
1250 if ($status == $sfNoSource)
1252 print "<img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /> </td>\n";
1254 if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i
)))
1256 print "<img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /> </td>\n";
1258 if (($status == $sfOutdated) && ($updatefile =~ /^download\//i
))
1260 print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
1263 print "\t\t<td align='center' nowrap='nowrap'> ";
1264 if ($vendorid =~ /^Adobe$/i)
1266 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
1267 } elsif ($vendorid =~ /^Microsoft$/i)
1269 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
1270 } elsif ($vendorid =~ /^Symantec$/i)
1272 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
1273 } elsif ($vendorid =~ /^Linux$/i)
1275 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
1276 } elsif ($vendorid =~ /^TrendMicro$/i)
1278 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
1279 } elsif ($vendorid =~ /^Apple$/i)
1281 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
1282 } elsif ($vendorid =~ /^Avast$/i)
1284 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
1285 } elsif ($vendorid =~ /^Avira$/i)
1287 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
1288 } elsif ($vendorid =~ /^AVG$/i)
1290 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
1291 } elsif ($vendorid =~ /^Ipfire$/i)
1293 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
1297 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
1299 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1301 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1305 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
1306 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
1309 <td class='base' align='left' title='cache:/$updatefile'><a href="/updatecache/$updatefile">$shortname</a></td>
1310 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
1311 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
1312 <td class='base' align='center' nowrap='nowrap'> $lastaccess </td>
1313 <td class='base' align='center' nowrap='nowrap'> $lastcheck </td>
1315 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
1316 <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'}' />
1317 <input type='hidden' name='ID' value='$updatefile' />
1318 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr remove file'}' />
1330 # -------------------------------------------------------------------
1332 sub printlegenddownload
1336 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1337 <td class='base'> </td>
1338 <td><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1339 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1340 <td class='base'> </td>
1341 <td class='base'> </td>
1342 <td><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /></td>
1343 <td class='base'>$Lang::tr{'updxlrtr condition suspended'}</td>
1344 <td class='base'> </td>
1345 <td class='base'> </td>
1346 <td><img src='/images/delete.gif' alt='$Lang::tr{'updxlrtr cancel download'}' /></td>
1347 <td class='base'>$Lang::tr{'updxlrtr cancel download'}</td>
1353 # -------------------------------------------------------------------
1355 sub printlegendicons
1362 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1363 <td class='base'> </td>
1364 <td><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1365 <td class='base'>$Lang::tr{'updxlrtr last access'}</td>
1366 <td class='base'> </td>
1367 <td><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1368 <td class='base'>$Lang::tr{'updxlrtr last checkup'}</td>
1369 <td class='base'> </td>
1370 <td><img src='/images/updbooster/delete.gif' alt='$Lang::tr{'updxlrtr remove file'}' /></td>
1371 <td class='base'>$Lang::tr{'updxlrtr remove file'}</td>
1372 <td class='base'> </td>
1373 <td class='base'> </td>
1374 <td class='base'> </td>
1380 # -------------------------------------------------------------------
1382 sub printlegendstatus
1386 <td class='base'> $Lang::tr{'status'}:</td>
1387 <td class='base'> </td>
1388 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
1389 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
1390 <td class='base'> </td>
1391 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1392 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
1393 <td class='base'> </td>
1394 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1395 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
1396 <td class='base'> </td>
1397 <td class='base'> </td>
1399 <td class='base'> </td>
1402 <td class='base'> </td>
1403 <td class='base'> </td>
1404 <td align='center'><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1405 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1406 <td class='base'> </td>
1407 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
1408 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
1409 <td class='base'> </td>
1410 <td class='base'> </td>
1411 <td class='base'> </td>
1412 <td class='base'> </td>
1413 <td class='base'> </td>
1415 <td class='base'> </td>
1421 # -------------------------------------------------------------------
1423 sub printlegendsource
1430 <td class='base'> $Lang::tr{'updxlrtr source'}:</td>
1431 <td class='base'> </td>
1432 <td align='center'><img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe' /></td>
1433 <td class='base'>Adobe</td>
1434 <td class='base'> </td>
1435 <td align='center'><img src='/images/updbooster/updxl-src-apple.gif' alt='Apple' /></td>
1436 <td class='base'>Apple</td>
1437 <td class='base'> </td>
1438 <td align='center'><img src='/images/updbooster/updxl-src-avast.gif' alt='Avast' /></td>
1439 <td class='base'>Avast</td>
1440 <td class='base'> </td>
1441 <td align='center'><img src='/images/updbooster/updxl-src-linux.gif' alt='Linux' /></td>
1442 <td class='base'>Linux</td>
1445 <td colspan='13'></td>
1448 <td class='base'> </td>
1449 <td class='base'> </td>
1450 <td align='center'><img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft' /></td>
1451 <td class='base'>Microsoft</td>
1452 <td class='base'> </td>
1453 <td align='center'><img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec' /></td>
1454 <td class='base'>Symantec</td>
1455 <td class='base'> </td>
1456 <td align='center'><img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro' /></td>
1457 <td class='base'>Trend Micro</td>
1458 <td class='base'> </td>
1459 <td align='center'><img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /></td>
1460 <td class='base'>IPFire</td>
1463 <td class='base'> </td>
1464 <td class='base'> </td>
1465 <td align='center'><img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /></td>
1466 <td class='base'>Avira</td>
1467 <td class='base'> </td>
1468 <td align='center'><img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /></td>
1469 <td class='base'>AVG</td>
1470 <td class='base'> </td>
1471 <td align='center'><img src='/images/updbooster/updxl-src-unknown.gif' alt='$Lang::tr{'updxlrtr other'}' /></td>
1472 <td class='base'>$Lang::tr{'updxlrtr other'}</td>
1473 <td class='base'> </td>
1474 <td align='center'></td>
1475 <td class='base'> </td>
1483 # -------------------------------------------------------------------
1485 sub printlegendspacer
1489 <td colspan='13'> <br></td>
1495 # -------------------------------------------------------------------
1499 if (-e
$chk_cron_dly) { unlink($chk_cron_dly); }
1500 if (-e
$chk_cron_wly) { unlink($chk_cron_wly); }
1501 if (-e
$chk_cron_mly) { unlink($chk_cron_mly); }
1503 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily'))
1505 symlink("../bin/checkup",$chk_cron_dly)
1507 symlink("/bin/false",$chk_cron_dly)
1509 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
1511 symlink("../bin/checkup",$chk_cron_wly)
1513 symlink("/bin/false",$chk_cron_wly)
1515 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
1517 symlink("../bin/checkup",$chk_cron_mly)
1519 symlink("/bin/false",$chk_cron_mly)
1522 # don't save those variable to the settings file,
1523 # but we wan't to have them in the hash again after saving to file
1524 my $obsolete = $xlratorsettings{'REMOVE_OBSOLETE'};
1525 my $nosource = $xlratorsettings{'REMOVE_NOSOURCE'};
1526 my $outdated = $xlratorsettings{'REMOVE_OUTDATED'};
1527 my $gui = $xlratorsettings{'EXTENDED_GUI'};
1529 delete($xlratorsettings{'REMOVE_OBSOLETE'});
1530 delete($xlratorsettings{'REMOVE_NOSOURCE'});
1531 delete($xlratorsettings{'REMOVE_OUTDATED'});
1533 delete($xlratorsettings{'EXTENDED_GUI'});
1535 &General
::writehash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
1537 # put temp variables back into the hash
1538 $xlratorsettings{'REMOVE_OBSOLETE'} = $obsolete;
1539 $xlratorsettings{'REMOVE_NOSOURCE'} = $nosource;
1540 $xlratorsettings{'REMOVE_OUTDATED'} = $outdated;
1541 $xlratorsettings{'EXTENDED_GUI'} = $gui;
1544 # -------------------------------------------------------------------
1548 my $percent = $_[0];
1552 if ($percent =~ m/^(\d+)%$/ )
1555 <table width='100' border='1' cellspacing='0' cellpadding='0' style='border-width:1px;border-style:solid;border-color:$fg;width:100px;height:10px;'>
1559 if ($percent eq "100%") {
1560 print "<td width='100%' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'>"
1561 } elsif ($percent eq "0%") {
1562 print "<td width='100%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
1564 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'>"
1567 <img src='/images/null.gif' width='1' height='1' alt='' /></td></tr></table>
1573 # -------------------------------------------------------------------
1577 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]);
1582 # -------------------------------------------------------------------
1587 my @psdata=`ps ax --no-heading`;
1591 if (/$_[0]/) { ($pid)=/^\s*(\d+)/; }
1597 # -------------------------------------------------------------------