X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fstat%2Froute_user.pl;h=e39584cb0877cef3bf8febfd875497380a554ff1;hb=412fb1b9e4070d7791f4e986b55bbc0c06f612ea;hp=37a079b8cc455e97793f2b137e0a95f6d4f7b932;hpb=60d889442d24ab5567fe0b6c9bb923f4297a07bd;p=spider.git diff --git a/cmd/stat/route_user.pl b/cmd/stat/route_user.pl index 37a079b8..e39584cb 100644 --- a/cmd/stat/route_user.pl +++ b/cmd/stat/route_user.pl @@ -7,16 +7,29 @@ # my ($self, $line) = @_; +my @out; my @list = split /\s+/, $line; # generate a list of callsigns @list = ($self->call) if !@list; # my channel if no callsigns +if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') { + push @out, "User Callsigns in Routing Table"; + @list = sort map {$_->call} Route::User::get_all(); + my $count = @list; + my $n = int $self->width / 10; + $n ||= 8; + while (@list > $n) { + push @out, join(' ', map {sprintf "%9s",$_ } splice(@list, 0, $n)); + } + push @out, join(' ', map {sprintf "%9s",$_ } @list) if @list; + push @out, "$count Users"; + return (1, @out); +} my $call; -my @out; foreach $call (@list) { $call = uc $call; my $ref = Route::User::get($call); if ($ref) { - @out = print_all_fields($self, $ref, "Route::User Information $call"); + push @out, print_all_fields($self, $ref, "Route::User Information $call"); } else { push @out, "Route::User: $call not found"; }