Change DXUser->get* to DXUser::get*
[spider.git] / cmd / unset / local_node.pl
1 #
2 # remove these nodes from the 'local_node' group
3 #
4 # Copyright (c) 2006 - Dirk Koopman G1TLH
5 #
6 #
7 #
8
9 my ($self, $line) = @_;
10 my @args = split /\s+/, uc $line;
11 my @out;
12
13 return (1, $self->msg('e5')) unless $self->priv >= 5;
14
15 foreach my $call (@args) {
16         my $user = DXUser::get_current($call);
17         push(@out, $self->msg('e3', 'set/localnode', $call)), next unless $user; 
18         push(@out, $self->msg('e13', $call)), next unless $user->is_node; 
19         my $group = $user->group || [];
20         my @new = grep {$_ ne 'local_node'} @$group;
21         $user->group(\@new);
22         my $dxchan = DXChannel::get($call);
23         $dxchan->group(\@new) if $dxchan;
24         push @out, $self->msg('lgunset', $call);
25         $user->put;
26 }
27
28 return (1, @out);