]> dxcluster.org Git - spider.git/blob - cmd/set/bbs.pl
fix last fix!
[spider.git] / cmd / set / bbs.pl
1 #
2 # set user type to 'B' for BBS node
3 #
4 # Please note that this is only effective if the user is not on-line
5 #
6 # Copyright (c) 2001 - 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         if ($call eq $main::myalias) {
27                 push @out, $self->msg('e11', $call);
28                 next;
29         }
30         my $chan = DXChannel::get($call);
31         if ($chan) {
32                 push @out, $self->msg('nodee1', $call);
33         } else {
34                 $user = DXUser::get($call);
35                 $create = !$user;
36                 $user = DXUser->new($call) if $create;
37                 if ($user) {
38                         $user->sort('B');
39                         $user->homenode($call);
40                         $user->close();
41                         push @out, $self->msg($create ? 'nodecc' : 'nodec', $call);
42                 } else {
43                         push @out, $self->msg('e3', "Set BBS", $call);
44                 }
45         }
46 }
47 return (1, @out);