back port registration from mojo
[spider.git] / cmd / show / log.pl
1 #
2 # print out the general log file
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 #
7 #
8 my $self = shift;
9
10 my $cmdline = shift;
11 my @f = split /\s+/, $cmdline;
12 my $f;
13 my @out;
14 my ($from, $to, $who, $hint); 
15
16 $from = 0;
17 while ($f = shift @f) {                 # next field
18         #  print "f: $f list: ", join(',', @list), "\n";
19         unless ($from || $to) {
20                 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o;         # is it a from -> to count?
21                 next if $from && $to > $from;
22         }
23         unless ($to) {
24                 ($to) = $f =~ /^(\d+)$/ if !$to;              # is it a to count?
25                 next if $to;
26         }
27         unless ($who) {
28                 $who = $f; 
29                 next if $who;
30         }
31 }
32
33 $to = 20 unless $to;
34 $from = 0 unless $from;
35
36 if ($self->priv < 6) {
37         return (1, $self->msg('e5')) if defined $who && $who ne $self->call;
38         $who = $self->call;
39 }
40
41 @out = DXLog::print($from, $to, $main::systime, undef, $who);
42 return (1, @out);