X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fstation.pl;h=55976a6917f709187e7dfd0e15ea37e7b8bcb7fd;hb=ab811a0c902225075a9bd69749f65594079433a9;hp=a79e93a8901572369718f984b370f8b6fb8972cf;hpb=78cf2dcb9be8128af7f8dc5ae37540c9c53c6057;p=spider.git diff --git a/cmd/show/station.pl b/cmd/show/station.pl index a79e93a8..55976a69 100644 --- a/cmd/show/station.pl +++ b/cmd/show/station.pl @@ -13,11 +13,20 @@ my $call; my $seek; push @f, $self->call unless @f; -if (@f == 1 && uc $f[0] eq 'ALL') { - return (1, $self->msg('e6')) if ($self->priv < 6); - my @calls = DXUser::get_all_calls(); +if (@f <= 2 && uc $f[0] eq 'ALL') { + return (1, $self->msg('e6')) if @f == 1 && $self->priv < 6; + return (1, $self->msg('e6')) if $self->priv < 5 || $f[1] eq '*'; + shift @f; + my $exp = shellregex(uc shift @f) if @f; + my @calls; + if ($exp) { + @calls = grep {m{$exp}} DXUser::get_all_calls(); + } else { + @calls = DXUser::get_all_calls(); + } + foreach $call (@calls) { - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); next if !$ref; my $lat = $ref->lat; my $long = $ref->long; @@ -33,7 +42,7 @@ if (@f == 1 && uc $f[0] eq 'ALL') { } } else { foreach $call (@f) { - my $ref = DXUser->get_current($call); + my $ref = DXUser::get_current($call); if ($ref) { my $name = $ref->name; my $qth = $ref->qth; @@ -61,19 +70,19 @@ if (@f == 1 && uc $f[0] eq 'ALL') { } my $cref = Route::get($call); - my $seek = join(',', $cref->parents) if $cref; + my $seek = $cref->isa('Route::Node') ? $call : join(',', $cref->parents) if $cref; if ($seek) { - push @out, "User : $call (at $seek)"; + push @out, sprintf("%-13s: %s (%s %s)", $self->msg('user'), $call, $self->msg('at'), $seek); } else { - push @out, "User : $call"; + push @out, sprintf("%-13s: %s", $self->msg('user'), $call); } - push @out, "Name : $name" if $name; - push @out, "Last Connect : $last" if $last; - push @out, "QTH : $qth" if $qth; - push @out, "Location : $latlong ($qra)" if $latlong || $qra ; - push @out, sprintf("Heading : %.0f Deg %.0f Mi. %.0f Km.", $bearing, $miles, $dx) if $latlong; - push @out, "Home Node : $homenode" if $homenode; + push @out, sprintf("%-13s: %s", $self->msg('name1'), $name) if $name; + push @out, sprintf("%-13s: %s", $self->msg('lastconn'), $last) if $last; + push @out, sprintf("%-13s: %s", 'QTH', $qth) if $qth; + push @out, sprintf("%-13s: %s", $self->msg('location'), "$latlong ($qra)") if $latlong || $qra ; + push @out, sprintf("%-13s: %.0f Deg. %.0f Mi. %.0f Km.", $self->msg('heading'), $bearing, $miles, $dx) if $latlong; + push @out, sprintf("%-13s: %s", $self->msg('homenode2'), $homenode) if $homenode; } else { push @out, $self->msg('usernf', $call); }