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