340b24344f6f541817c6bc89890c73e80d4dd5e2
[spider.git] / cmd / show / registered.pl
1 #
2 # show/registered
3 #
4 # show all registered users 
5 #
6 # Copyright (c) 2001 Dirk Koopman G1TLH
7 #
8 # $Id$
9 #
10
11 my ($self, $line) = @_;
12 return (1, $self->msg('e5')) unless $self->priv >= 9;
13
14 my @out;
15
16 use DB_File;
17
18 if ($line) {
19         $line =~ s/[^\w\-\/]+//g;
20         $line = "^\U\Q$line";
21 }
22
23 my ($action, $count, $key, $data) = (0,0,0,0);
24 for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) {
25         if ($data =~ m{registered}) {                                   
26                 if (!$line || ($line && $key =~ /$line/)) {
27                         my $u = DXUser->get_current($key);
28                         if ($u && $u->registered) {
29                                 push @out, $key;
30                                 ++$count;
31                         }
32                 }
33         }
34
35
36 return (1, @out, $self->msg('rec', $count));
37
38