]> gb7djk.dxcluster.net Git - spider.git/blob - cmd/set/user.pl
try fix node type changes from outside
[spider.git] / cmd / set / user.pl
1 #
2 # set back to user
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 < 5;
19
20 foreach $call (@args) {
21         $call = uc $call;
22         if ($call eq $main::mycall) {
23                 push @out, $self->msg('e11', $call);
24                 next;
25         }
26         my $chan = DXChannel::get($call);
27         if ($chan) {
28                 push @out, $self->msg('nodee1', $call);
29         } else {
30                 $user = DXUser::get($call);
31                 return (1, $self->msg('usernf', $call)) if !$user;
32                 $user->sort('U');
33                 $user->priv(0);
34                 $user->close();
35                 push @out, $self->msg('nodeu', $call);
36         }
37 }
38 return (1, @out);