]> www.dxcluster.org Git - spider.git/blob - cmd/show/isolate.pl
Merge branch 'mojo' of /scm/spider into mojo
[spider.git] / cmd / show / isolate.pl
1 #
2 # show/isolate
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 >= 1;
13
14 my @out;
15
16 use DB_File;
17
18 @out = $self->spawn_cmd(sub {
19                                                         my @out;
20                                                         my @val;
21                                                         
22                                                         my ($action, $count, $key, $data) = (0,0,0,0);
23
24                                                         for ($action = DXUser::R_FIRST, $count=0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) {
25                                                                 if ($data =~ m{isolate}) {
26                                                                         my $u = DXUser::get_current($key);
27                                                                         if ($u && $u->isolate) {
28                                                                                 push @val, $key;
29                                                                                 ++$count;
30                                                                         }
31                                                                 }
32                                                         } 
33
34                                                         my @l;
35                                                         foreach my $call (@val) {
36                                                                 if (@l >= 5) {
37                                                                         push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;
38                                                                         @l = ();
39                                                                 }
40                                                                 push @l, $call;
41                                                         }
42                                                         if (@l) {
43                                                                 push @l, "" while @l < 5;
44                                                                 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;
45                                                         }
46
47                                                         push @out, , $self->msg('rec', $count);
48                                                         return @out;
49                                                 });
50
51
52 return (1, @out);
53
54