X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fregistered.pl;fp=cmd%2Fshow%2Fregistered.pl;h=ebc468d1cf2a44a2f9fc6e05187de03d7f4daae5;hb=579810d363939640538f88a9caa86e01fe9c7709;hp=0000000000000000000000000000000000000000;hpb=5b803645eaf1a462937d7cde0e9459f1a6d3f10e;p=spider.git diff --git a/cmd/show/registered.pl b/cmd/show/registered.pl new file mode 100644 index 00000000..ebc468d1 --- /dev/null +++ b/cmd/show/registered.pl @@ -0,0 +1,38 @@ +# +# show/registered +# +# show all registered users +# +# Copyright (c) 2001 Dirk Koopman G1TLH +# +# $Id$ +# + +my ($self, $line) = @_; +return (1, $self->msg('e5')) unless $self->priv >= 9; + +my @out; + +use DB_File; + +if ($line) { + $line =~ s/[^\w\-\/]+//g; + $line = "^\U\Q$line"; +} + +my ($action, $count, $key, $data) = (0,0,0,0); +for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) { + if ($data =~ m{registered =>}) { + if (!$line || ($line && $key =~ /$line/)) { + my $u = DXUser->get_current($key); + if ($u && $u->registered) { + push @out, $key; + ++$count; + } + } + } +} + +return (1, @out, $self->msg('rec', $count)); + +