X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fisolate.pl;h=35eb822a2920f5341a15ec57b262b2f8116fbfa3;hb=99da9d68a4fee5b30fa90b679a9e015add2b75c9;hp=bea994fa7af2e112e16a0fcbeb5e5d1aa50f41ce;hpb=bff9ecf00b14e7d71d9504088a2fd7b9e5115fe1;p=spider.git diff --git a/cmd/show/isolate.pl b/cmd/show/isolate.pl index bea994fa..35eb822a 100644 --- a/cmd/show/isolate.pl +++ b/cmd/show/isolate.pl @@ -11,6 +11,21 @@ my ($self, $line) = @_; return (1, $self->msg('e5')) unless $self->priv >= 1; -# search thru the user for nodes -my @out = sort map { my $ref; (($ref = DXUser->get_current($_)) && $ref->isolate) ? $_ : () } DXUser::get_all_calls; -return (1, @out); +my @out; + +use DB_File; + +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{isolate\s*=>}) { + my $u = DXUser->get_current($key); + if ($u && $u->isolate) { + push @out, $key; + ++$count; + } + } +} + +return (1, @out, $self->msg('rec', $count)); + +