]> dxcluster.net Git - spider.git/blob - cmd/set/isolate.pl
fix sh/425 (mostly - bull doesn't work)
[spider.git] / cmd / set / isolate.pl
1 #
2 # set isolation for this node
3 #
4 # Please note that this is only effective if the user is not on-line
5 #
6 # Copyright (c) 1998 - Dirk Koopman
7 #
8 #
9 #
10
11 my ($self, $line) = @_;
12 my @args = split /\s+/, $line;
13 my $call;
14 my @out;
15 my $user;
16 my $create;
17
18 return (1, $self->msg('e5')) if $self->priv < 9;
19
20 foreach $call (@args) {
21         $call = uc $call;
22         my $chan = DXChannel::get($call);
23         if ($chan) {
24                 push @out, $self->msg('nodee1', $call);
25         } else {
26                 $user = DXUser::get($call);
27                 $create = !$user;
28                 $user = DXUser->new($call) if $create;
29                 my $f;
30                 push(@out, $self->msg('isoari', $call)), $f++ if Filter::getfn('route', $call, 1);
31                 push(@out, $self->msg('isoaro', $call)), $f++ if Filter::getfn('route', $call, 0);
32                 if ($user) {
33                         unless ($f) {
34                                 $user->isolate(1);
35                                 $user->close();
36                                 push @out, $self->msg($create ? 'isoc' : 'iso', $call);
37                                 Log('DXCommand', $self->msg($create ? 'isoc' : 'iso', $call));
38                         }
39                 } else {
40                         push @out, $self->msg('e3', "Set/Isolate", $call);
41                 }
42         }
43 }
44 return (1, @out);