Change DXUser->get* to DXUser::get*
[spider.git] / cmd / set / local_node.pl
1 #
2 # add these nodes to 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         push @$group, 'local_node' unless grep $_ eq 'local_node', @$group;
21         my $dxchan = DXChannel::get($call);
22         $dxchan->group($group) if $dxchan;
23         push @out, $self->msg('lgset', $call);
24         $user->put;
25 }
26
27 return (1, @out);