spider/cmd/connect.pl
Dirk Koopman ab811a0c90 Change DXUser->get* to DXUser::get*
and also check the output of thaw more carefully, complain if it
isn't a DXUser.
2008-05-06 15:00:00 +01:00

25 lines
683 B
Perl

#
# connect a cluster station
#
my $self = shift;
my $call = uc shift;
my $lccall = lc $call;
return (1, $self->msg('e5')) if $self->priv < 5;
return (1, $self->msg('e6')) unless $call gt ' ';
return (1, $self->msg('already', $call)) if DXChannel::get($call);
return (1, $self->msg('outconn', $call)) if grep {$_->{call} eq $call} @main::outstanding_connects;
return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall";
my $user = DXUser::get($call);
return (1, $self->msg('lockout', $call)) if $user && $user->lockout;
my @out;
push @out, $self->msg('constart', $call);
ExtMsg::start_connect($call, "$main::root/connect/$lccall");
return (1, @out);