]> scm.dxcluster.org Git - spider.git/blob - cmd/show/lockout.pl
AsyncMsgise sh/db0sdx
[spider.git] / cmd / show / lockout.pl
1 #
2 # show/lockout
3 #
4 # show all excluded users 
5 #
6 # Copyright (c) 2000 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 return (1, $self->msg('lockoutuse')) unless $line;
24
25 my ($action, $count, $key, $data) = (0,0,0,0);
26 eval qq{for (\$action = DXUser::R_FIRST, \$count = 0; !\$DXUser::dbm->seq(\$key, \$data, \$action); \$action = DXUser::R_NEXT) {
27         if (\$data =~ m{lockout}) {
28                 if (\$line eq 'ALL' || \$key =~ /^$line/) {
29                         my \$ur = DXUser::get_current(\$key);
30                         if (\$ur && \$ur->lockout) {
31                                 push \@out, \$key;
32                                 ++\$count;
33                         }
34                 }
35         }
36 } };
37
38 push @out, $@ if $@;
39
40 return (1, @out, $self->msg('rec', $count));
41
42