-
- # set up the basic channel info - this needs a bit more thought - there is duplication here
- if (!defined $dxchan) {
- my ($sort, $call, $line) = DXChannel::decode_input(0, $msg);
- return unless defined $sort;
-
- # is there one already connected to me - locally?
- my $user = DXUser->get($call);
- if (DXChannel->get($call)) {
- my $mess = DXM::msg($lang, ($user && $user->is_node) ? 'concluster' : 'conother', $call, $main::mycall);
- already_conn($conn, $call, $mess);
+
+ # set up the basic channel info
+ # is there one already connected to me - locally?
+ my $user = DXUser->get_current($call);
+ my $dxchan = DXChannel->get($call);
+ if ($dxchan) {
+ my $mess = DXM::msg($lang, ($user && $user->is_node) ? 'concluster' : 'conother', $call, $main::mycall);
+ already_conn($conn, $call, $mess);
+ return;
+ }
+
+ # is he locked out ?
+ my $basecall = $call;
+ $basecall =~ s/-\d+$//;
+ my $baseuser = DXUser->get_current($basecall);
+ my $lock = $user->lockout if $user;
+ if ($baseuser && $baseuser->lockout || $lock) {
+ if (!$user || !defined $lock || $lock) {
+ my $host = $conn->{peerhost} || "unknown";
+ Log('DXCommand', "$call on $host is locked out, disconnected");
+ $conn->disconnect;