Change DXUser->get* to DXUser::get*
[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 #
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 eval qq{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 push @out, $@ if $@;
37
38 return (1, @out, $self->msg('rec', $count));
39
40