]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | #!/usr/bin/perl |
2 | # | |
3 | # SmoothWall CGIs | |
4 | # | |
5 | # This code is distributed under the terms of the GPL | |
6 | # | |
7 | # (c) The SmoothWall Team | |
8 | # | |
9 | # $Id: log.dat,v 1.6.2.22 2006/01/03 12:47:17 franck78 Exp $ | |
10 | # | |
11 | ||
12 | use strict; | |
13 | ||
14 | # enable only the following on debugging purpose | |
5595bc03 CS |
15 | use warnings; |
16 | use CGI::Carp 'fatalsToBrowser'; | |
cd1a2927 | 17 | |
986e08d9 | 18 | require '/var/ipfire/general-functions.pl'; |
cd1a2927 MT |
19 | require "${General::swroot}/lang.pl"; |
20 | require "${General::swroot}/header.pl"; | |
21 | ||
f2fdd0c1 CS |
22 | my %color = (); |
23 | my %mainsettings = (); | |
24 | &General::readhash("${General::swroot}/main/settings", \%mainsettings); | |
8186b372 | 25 | &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); |
f2fdd0c1 | 26 | |
cd1a2927 MT |
27 | use POSIX(); |
28 | ||
cd1a2927 MT |
29 | my %cgiparams=(); |
30 | my %logsettings=(); | |
31 | my $errormessage = ''; | |
32 | ||
33 | my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', | |
34 | 'Sep', 'Oct', 'Nov', 'Dec' ); | |
35 | my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'}, | |
36 | $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'}, | |
37 | $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'}, | |
38 | $Lang::tr{'december'} ); | |
39 | ||
40 | my @now = localtime(); | |
41 | my $dow = $now[6]; | |
42 | my $doy = $now[7]; | |
43 | my $tdoy = $now[7]; | |
44 | my $year = $now[5]+1900; | |
45 | ||
46 | $cgiparams{'DAY'} = $now[3]; | |
47 | $cgiparams{'MONTH'} = $now[4]; | |
48 | $cgiparams{'ACTION'} = ''; | |
97fe1741 | 49 | $cgiparams{'SECTION'} = 'ipfire'; |
cd1a2927 MT |
50 | |
51 | my %sections = ( | |
284ebca0 | 52 | 'apcupsd' => '(apcupsd\[.*?\]: )', |
5e818d6a | 53 | 'auth' => '(\w+\(pam_unix\)\[.*\]: )', |
a15c20fd | 54 | 'wio' => '(wio:|wio\[.*\])', |
6d31cfdd | 55 | 'captive' => '(Captive:)', |
4f57d698 | 56 | 'clamav' => '(clamd\[.*\]: |freshclam\[.*\]: )', |
5362088b | 57 | 'collectd' => '(collectd\[.*\]: )', |
5595bc03 | 58 | 'cron' => '(fcron\[.*\]: )', |
5e818d6a MF |
59 | 'ddns' => '(ddns\[\d+\]:)', |
60 | 'dhcp' => '(dhcpd: )', | |
11121641 | 61 | 'dma' => '(dma: |dma\[.*\]: |postfix/\w*\[\d*\]: )', |
5e818d6a | 62 | 'guardian' => '(guardian\[.*\]: )', |
452fd239 | 63 | 'haproxy' => '(haproxy\[.*?\]: )', |
c0472dcf | 64 | 'ipblocklist' => '(ipblocklist: )', |
5e818d6a | 65 | 'ipfire' => '(ipfire: )', |
0e14ef8a | 66 | 'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |charon: |vpnwatch: )', |
5e818d6a | 67 | 'kernel' => '(kernel: (?!DROP_))', |
8f58e661 | 68 | 'monit' => '(monit\[.*?\]: )', |
5e818d6a | 69 | 'ntp' => '(ntpd(?:ate)?\[.*\]: )', |
a15c20fd AB |
70 | 'nut' => '(upsmon\[.*?\]: )', |
71 | 'oinkmaster' => '(oinkmaster\[.*\]: )', | |
0f0db884 | 72 | 'openvpn' => '(openvpnserver\[.*\]: |.*n2n\[.*\]: )', |
5e818d6a MF |
73 | 'pakfire' => '(pakfire:)', |
74 | 'red' => '(red:|pppd\[.*\]: |chat\[.*\]|pppoe\[.*\]|pptp\[.*\]|pppoa\[.*\]|pppoa3\[.*\]|pppoeci\[.*\]|ipppd|ipppd\[.*\]|kernel: ippp\d|kernel: isdn.*|ibod\[.*\]|dhcpcd\[.*\]|modem_run\[.*\])', | |
a15c20fd | 75 | 'samba' => '(nmbd|smbd|winbind)\[\d+\]:', |
830dfc97 | 76 | 'suricata' => '(suricata: )', |
5e818d6a MF |
77 | 'squid' => '(squid\[.*\]: |squid: )', |
78 | 'ssh' => '(sshd(?:\(.*\))?\[.*\]: )', | |
4bb38923 | 79 | 'unbound' => '(unbound: \[.*?\])(.*:.*$)', |
5e818d6a MF |
80 | 'urlfilter bl' => '(installpackage\[urlfilter\]: )', |
81 | 'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:)' | |
cd1a2927 MT |
82 | ); |
83 | ||
84 | # Translations for the %sections array. | |
85 | my %trsections = ( | |
284ebca0 | 86 | 'apcupsd' => 'APCUPS', |
5e818d6a | 87 | 'auth' => "$Lang::tr{'loginlogout'}", |
a15c20fd | 88 | 'wio' => 'Who Is Online?', |
e26a5c48 | 89 | 'captive' => $Lang::tr{'Captive'}, |
5e818d6a MF |
90 | 'clamav' => 'ClamAV', |
91 | 'collectd' => 'Collectd', | |
92 | 'cron' => 'Cron', | |
9494c611 | 93 | 'ddns' => "$Lang::tr{'dynamic dns'}", |
cd1a2927 | 94 | 'dhcp' => "$Lang::tr{'dhcp server'}", |
5e818d6a | 95 | 'dma' => 'Mail', |
5e818d6a | 96 | 'guardian' => "$Lang::tr{'guardian'}", |
452fd239 | 97 | 'haproxy' => 'HAProxy', |
c0472dcf | 98 | 'ipblocklist' => "$Lang::tr{'ipblocklist'}", |
5e818d6a | 99 | 'ipfire' => 'IPFire', |
cd1a2927 | 100 | 'ipsec' => 'IPSec', |
5e818d6a | 101 | 'kernel' => "$Lang::tr{'kernel'}", |
0b2aa517 | 102 | 'monit' => 'Monit', |
5e818d6a | 103 | 'ntp' => 'NTP', |
a15c20fd AB |
104 | 'nut' => 'NUT', |
105 | 'oinkmaster' => 'Oinkmaster', | |
6e13d0a5 | 106 | 'openvpn' => 'OpenVPN', |
c506cad0 | 107 | 'pakfire' => 'Pakfire', |
5e818d6a | 108 | 'red' => 'RED', |
a15c20fd | 109 | 'samba' => $Lang::tr{'samba'}, |
9f9651e0 | 110 | 'suricata' => "$Lang::tr{'intrusion detection'}", |
5e818d6a MF |
111 | 'squid' => "$Lang::tr{'web proxy'}", |
112 | 'ssh' => 'SSH', | |
d659de88 | 113 | 'unbound' => 'DNS: Unbound', |
5e818d6a MF |
114 | 'urlfilter bl' => 'URLFilter Blacklist', |
115 | 'wireless' => 'Wireless' | |
cd1a2927 MT |
116 | ); |
117 | ||
118 | ||
119 | &Header::getcgihash(\%cgiparams); | |
120 | $logsettings{'LOGVIEW_REVERSE'} = 'off'; | |
121 | &General::readhash("${General::swroot}/logging/settings", \%logsettings); | |
122 | ${Header::viewsize} = defined ($logsettings{'LOGVIEW_VIEWSIZE'}) ? $logsettings{'LOGVIEW_VIEWSIZE'} : 150; | |
123 | ||
124 | my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0; #index of firts line number to display | |
125 | ||
126 | if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) | |
127 | { | |
128 | my @temp = split(',',$ENV{'QUERY_STRING'}); | |
129 | $start = $temp[0]; | |
130 | $cgiparams{'MONTH'} = $temp[1]; | |
131 | $cgiparams{'DAY'} = $temp[2]; | |
132 | $cgiparams{'SECTION'} = $temp[3]; | |
133 | } | |
134 | ||
135 | if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) || | |
136 | !($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/)) | |
137 | { | |
138 | $cgiparams{'DAY'} = $now[3]; | |
139 | $cgiparams{'MONTH'} = $now[4]; | |
140 | } | |
141 | elsif($cgiparams{'ACTION'} eq '>>') | |
142 | { | |
143 | my @temp_then=(); | |
144 | my @temp_now = localtime(time); | |
145 | $temp_now[4] = $cgiparams{'MONTH'}; | |
146 | $temp_now[3] = $cgiparams{'DAY'}; | |
147 | if ($cgiparams{'DAY'}) { | |
148 | @temp_then = localtime(POSIX::mktime(@temp_now) + 86400); | |
149 | ## Retrieve the same time on the next day + | |
150 | ## 86400 seconds in a day | |
151 | } else { | |
152 | $temp_now[3] = 1; | |
153 | $temp_now[4] = ($temp_now[4]+1) %12; | |
154 | @temp_then = localtime(POSIX::mktime(@temp_now) ); | |
155 | $temp_then[3] = 0; | |
156 | } | |
157 | $cgiparams{'MONTH'} = $temp_then[4]; | |
158 | $cgiparams{'DAY'} = $temp_then[3]; | |
159 | } | |
160 | elsif($cgiparams{'ACTION'} eq '<<') | |
161 | { | |
162 | my @temp_then=(); | |
163 | my @temp_now = localtime(time); | |
164 | $temp_now[4] = $cgiparams{'MONTH'}; | |
165 | $temp_now[3] = $cgiparams{'DAY'}; | |
166 | if ($cgiparams{'DAY'}) { | |
167 | @temp_then = localtime(POSIX::mktime(@temp_now) - 86400); | |
168 | ## Retrieve the same time on the next day - | |
169 | ## 86400 seconds in a day | |
170 | } else { | |
171 | $temp_now[3] = 1; | |
172 | $temp_now[4] = ($temp_now[4]-1) %12; | |
173 | @temp_then = localtime(POSIX::mktime(@temp_now) ); | |
174 | $temp_then[3] = 0; | |
175 | } | |
176 | $cgiparams{'MONTH'} = $temp_then[4]; | |
177 | $cgiparams{'DAY'} = $temp_then[3]; | |
178 | } | |
179 | ||
180 | # Find in which file.gz is the log. Can be calculated because WEEKLY ROTATING of access.log | |
181 | my $gzindex; | |
182 | my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" : "$cgiparams{'DAY'}"; | |
183 | ||
184 | { | |
185 | my $xday; | |
9f663e66 | 186 | |
cd1a2927 MT |
187 | # Calculate time. If future date, calculate for past year !!! |
188 | if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) || | |
189 | ( $cgiparams{'MONTH'} > $now[4] ) ) { | |
190 | $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ); | |
191 | $date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1); | |
192 | } else { | |
193 | $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ); | |
194 | $date = "$longmonths[$cgiparams{'MONTH'}] $date, $year"; | |
195 | } | |
196 | ||
197 | # calculate end of active week (saturday 23H59) | |
198 | my @then = (); | |
199 | @then = localtime(time()); | |
0d08de33 | 200 | my $sunday = POSIX::mktime( 0, 0, 0, $then[3], $then[4], $then[5]); |
cd1a2927 MT |
201 | $sunday += (6-$then[6]) * 86400; |
202 | ||
203 | # Convert delta in second to full weeks | |
204 | $gzindex = int (($sunday-$xday)/604800 ); | |
205 | } | |
9f663e66 | 206 | |
cd1a2927 MT |
207 | my $monthstr = $shortmonths[$cgiparams{'MONTH'}]; |
208 | my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}"; | |
209 | my $section = $sections{$cgiparams{'SECTION'}}; | |
210 | ||
211 | my $lines = 0; | |
212 | my @log=(); | |
213 | ||
214 | my $loop = 1; | |
215 | my $filestr = 0; | |
216 | my $lastdatetime; # for debug | |
217 | my $search_for_end = 0; | |
9f663e66 | 218 | |
cd1a2927 MT |
219 | while ($gzindex >=0 && $loop) { |
220 | # calculate file name | |
221 | if ($gzindex == 0) { | |
222 | $filestr = "/var/log/messages"; | |
1986cc88 | 223 | $filestr = "/var/log/mail" if (${section} =~ 'dma'); |
cd1a2927 MT |
224 | } else { |
225 | $filestr = "/var/log/messages.$gzindex"; | |
1986cc88 | 226 | $filestr = "/var/log/mail.$gzindex" if (${section} =~ 'dma'); |
cd1a2927 MT |
227 | $filestr = "$filestr.gz" if -f "$filestr.gz"; |
228 | } | |
229 | # now read file if existing | |
230 | if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) { | |
231 | #&General::log("reading $filestr"); | |
232 | READ:while (<FILE>) { | |
233 | my $line = $_; | |
5595bc03 | 234 | if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ ${section}(.*)/) { |
5e818d6a | 235 | # when standard viewing, just keep in memory the correct slice |
cd1a2927 MT |
236 | # it starts a '$start' and size is $viewport |
237 | # If export, then keep all lines... | |
238 | if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){ | |
239 | $log[$lines++] = "$line"; | |
240 | } else { | |
241 | if ($lines++ < ($start + $Header::viewsize)) { | |
242 | push(@log,"$line"); | |
243 | if (@log > $Header::viewsize) { | |
244 | shift (@log); | |
245 | } | |
5e818d6a | 246 | #} else { don't do this optimisation, need to count lines ! |
cd1a2927 MT |
247 | # $datetime = $maxtime; # we have read viewsize lines, stop main loop |
248 | # last READ; # exit read file | |
249 | } | |
250 | } | |
251 | $search_for_end = 1; # we find the start of slice, can look for end now | |
252 | } else { | |
253 | if ($search_for_end == 1) { | |
254 | #finish read files when date is over (test month equality only) | |
255 | $line =~ /^(...) (..) ..:..:..*$/; | |
256 | $loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) ); | |
257 | } | |
258 | } | |
259 | } | |
260 | close (FILE); | |
261 | } | |
262 | $gzindex--; # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped | |
263 | # for a long time | |
264 | }# while | |
265 | ||
266 | # $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}"; | |
267 | ||
268 | if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}) | |
269 | { | |
270 | print "Content-type: text/plain\n\n"; | |
78331e30 | 271 | print "IPFire diagnostics\r\n"; |
cd1a2927 MT |
272 | print "$Lang::tr{'section'}: $cgiparams{'SECTION'}\n"; |
273 | print "$Lang::tr{'date'}: $date\r\n\r\n"; | |
274 | ||
275 | if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; } | |
276 | ||
277 | foreach $_ (@log) | |
278 | { | |
5595bc03 | 279 | /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/; |
cd1a2927 MT |
280 | my $day = $1; |
281 | $day =~ tr / /0/; | |
282 | my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ; | |
5595bc03 | 283 | print "$time $3 $4\r\n"; |
cd1a2927 MT |
284 | } |
285 | exit 0; | |
286 | } | |
287 | ||
288 | &Header::showhttpheaders(); | |
289 | ||
986e08d9 | 290 | &Header::openpage($Lang::tr{'system logs'}, 1, ''); |
cd1a2927 MT |
291 | |
292 | &Header::openbigbox('100%', 'left', '', $errormessage); | |
293 | ||
294 | if ($errormessage) { | |
295 | &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); | |
296 | print "<font class='base'>$errormessage </font>\n"; | |
297 | &Header::closebox(); | |
298 | } | |
299 | ||
300 | &Header::openbox('100%', 'left', "$Lang::tr{'settings'}:"); | |
301 | ||
302 | print <<END | |
303 | <form method='post' action='$ENV{'SCRIPT_NAME'}'> | |
304 | <table width='100%'> | |
305 | <tr> | |
306 | <td width='10%' class='base'>$Lang::tr{'section'}: </td> | |
307 | <td width='20%'> | |
308 | <select name='SECTION'> | |
309 | END | |
310 | ; | |
5e818d6a | 311 | foreach $section (sort {$trsections{$a} cmp $trsections{$b}} keys %sections) { |
cd1a2927 MT |
312 | print "\t<option "; |
313 | if ($section eq $cgiparams{'SECTION'}) { | |
314 | print "selected='selected' "; } | |
315 | print "value='$section'>$trsections{$section}</option>\n"; | |
316 | } | |
317 | print <<END | |
318 | </select> | |
319 | </td> | |
320 | <td width='10%' class='base' align='right'>$Lang::tr{'month'}: </td> | |
321 | <td width='10%'> | |
322 | <select name='MONTH'> | |
323 | END | |
324 | ; | |
325 | for (my $month = 0; $month < 12; $month++) | |
326 | { | |
327 | print "\t<option "; | |
328 | if ($month == $cgiparams{'MONTH'}) { | |
329 | print "selected='selected' "; } | |
330 | print "value='$month'>$longmonths[$month]</option>\n"; | |
331 | } | |
332 | print <<END | |
333 | </select> | |
334 | </td> | |
335 | <td width='10%' class='base' align='right'> $Lang::tr{'day'}: </td> | |
336 | <td width='40%'> | |
337 | <select name='DAY'> | |
338 | END | |
339 | ; | |
340 | print "<option value='0'>$Lang::tr{'all'}</option>\n"; | |
9f663e66 | 341 | for (my $day = 1; $day <= 31; $day++) |
cd1a2927 MT |
342 | { |
343 | print "\t<option "; | |
344 | if ($day == $cgiparams{'DAY'}) { | |
345 | print "selected='selected' "; } | |
346 | print "value='$day'>$day</option>\n"; | |
347 | } | |
348 | print <<END | |
349 | </select> | |
350 | </td> | |
351 | <td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day before'}' value='<<' /></td> | |
352 | <td width='5%' align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day after'}' value='>>' /></td> | |
353 | <td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td> | |
354 | <td width='10%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'export'}' /></td> | |
355 | </tr> | |
356 | </table> | |
357 | </form> | |
358 | END | |
359 | ; | |
360 | ||
361 | &Header::closebox(); | |
362 | ||
363 | &Header::openbox('100%', 'left', $Lang::tr{'log'}); | |
364 | print "<p><b>$Lang::tr{'total hits for log section'} $cgiparams{'SECTION'} $date: $lines</b></p>"; | |
365 | ||
366 | $start = $lines - ${Header::viewsize} if ($start >= $lines - ${Header::viewsize}); | |
367 | $start = 0 if ($start < 0); | |
368 | ||
369 | my $prev; | |
370 | if ($start == 0) { | |
371 | $prev = -1; | |
372 | } else { | |
373 | $prev = $start - ${Header::viewsize}; | |
374 | $prev = 0 if ( $prev < 0); | |
375 | } | |
9f663e66 | 376 | |
cd1a2927 MT |
377 | my $next; |
378 | if ($start == $lines - ${Header::viewsize}) { | |
379 | $next = -1; | |
380 | } else { | |
381 | $next = $start + ${Header::viewsize}; | |
382 | $next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize}); | |
383 | } | |
384 | ||
385 | if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; } | |
386 | if ($lines != 0) { &oldernewer(); } | |
387 | ||
388 | print <<END | |
fda1f52f | 389 | <table width='100%' class='tbl'> |
cd1a2927 | 390 | <tr> |
fda1f52f | 391 | <th width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th> |
5e818d6a MF |
392 | <th width='15%' align='center' class='boldbase'><b>$Lang::tr{'section'}</b></th> |
393 | <th width='75%'> </th> | |
cd1a2927 MT |
394 | </tr> |
395 | END | |
396 | ; | |
397 | ||
398 | $lines = 0; | |
399 | #print '<tt>'; | |
400 | foreach $_ (@log) | |
401 | { | |
5595bc03 | 402 | /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/; |
cd1a2927 MT |
403 | my $day = $1; |
404 | $day =~ tr / /0/; | |
405 | my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ; | |
406 | my $sec = $3; | |
407 | my $data = $4; | |
408 | # correct the cut position, just when section=RED | |
409 | if (($cgiparams{'SECTION'} eq 'red' ) && ($sec =~ /(kernel:)(.*)/)) { | |
410 | $sec = 'kernel'; | |
411 | $data = $2.': '.$data; | |
412 | } | |
413 | my $d = substr ($data,0,80); | |
414 | while (length($data)>80){ #very basic breaking of lines... | |
415 | $data = substr ($data,80); #permit correct display in table cell | |
416 | $d .= ' ' . substr ($data,0,80); | |
417 | } | |
fda1f52f | 418 | my $col=""; |
cd1a2927 MT |
419 | |
420 | if ($lines % 2) { | |
fda1f52f AM |
421 | print "<tr>"; |
422 | $col="bgcolor='$color{'color20'}'"; } | |
cd1a2927 | 423 | else { |
fda1f52f AM |
424 | print "<tr>"; |
425 | $col="bgcolor='$color{'color22'}'"; } | |
426 | print "<td $col>$time<td $col>$sec<td $col>" .&Header::cleanhtml ("$d", 'y') . "</td></tr>\n"; | |
cd1a2927 MT |
427 | $lines++; |
428 | } | |
429 | #print '</tt>'; | |
430 | print "</table>"; | |
431 | ||
432 | &oldernewer(); | |
433 | ||
434 | &Header::closebox(); | |
435 | ||
436 | &Header::closebigbox(); | |
437 | ||
438 | &Header::closepage(); | |
439 | ||
440 | sub oldernewer | |
441 | { | |
442 | print <<END | |
443 | <table width='100%'> | |
444 | <tr> | |
445 | END | |
446 | ; | |
447 | ||
448 | print "<td align='center' width='50%'>"; | |
449 | if ($prev != -1) { | |
450 | print "<a href='/cgi-bin/logs.cgi/log.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SECTION'}'>$Lang::tr{'older'}</a>"; } | |
451 | else { | |
452 | print "$Lang::tr{'older'}"; } | |
453 | print "</td>\n"; | |
454 | ||
455 | print "<td align='center' width='50%'>"; | |
456 | if ($next >= 0) { | |
457 | print "<a href='/cgi-bin/logs.cgi/log.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SECTION'}'>$Lang::tr{'newer'}</a>"; } | |
458 | else { | |
459 | print "$Lang::tr{'newer'}"; } | |
460 | print "</td>\n"; | |
461 | ||
462 | print <<END | |
463 | </tr> | |
464 | </table> | |
465 | END | |
466 | ; | |
467 | } |