X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcluster.pl;h=3596fa00432169199ff9dbcf55121c79c00d4ea7;hb=a79ed63d7b2c53c1f360512afa2a68ba311b9554;hp=98eabf63bc7f30d10749535ffec969243cd32588;hpb=8f58735f5c9c090f2e5e00e05c7ad0834eccb741;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index 98eabf63..3596fa00 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -111,7 +111,7 @@ $starttime = 0; # the starting time of the cluster use vars qw($VERSION $BRANCH $build $branch); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; -$main::build += 15; # add an offset to make it bigger than last system +$main::build += 14; # add an offset to make it bigger than last system $main::build += $VERSION; $main::branch += $BRANCH; @@ -141,7 +141,12 @@ sub new_channel my ($conn, $msg) = @_; my ($sort, $call, $line) = DXChannel::decode_input(0, $msg); return unless defined $sort; - + + unless (is_callsign($call)) { + already_conn($conn, $call, DXM::msg($lang, "illcall", $call)); + return; + } + # set up the basic channel info # is there one already connected to me - locally? my $user = DXUser->get($call); @@ -151,6 +156,20 @@ sub new_channel already_conn($conn, $call, $mess); return; } + + # is he locked out ? + my $basecall = $call; + $basecall =~ s/-\d+$//; + my $baseuser = DXUser->get($basecall); + if ($baseuser && $baseuser->lockout) { + my $lock = $user->lockout if $user; + if (!$user || !defined $lock || $lock) { + my $host = $conn->{peerhost} || "unknown"; + Log('DXCommand', "$call on $host is locked out, disconnected"); + $conn->disconnect; + return; + } + } if ($user) { $user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems @@ -158,13 +177,6 @@ sub new_channel $user = DXUser->new($call); } - # is he locked out ? - if ($user->lockout) { - my $host = $conn->{peerhost} || "unknown"; - Log('DXCommand', "$call on $host is locked out, disconnected"); - $conn->disconnect; - return; - } # create the channel $dxchan = DXCommandmode->new($call, $conn, $user) if $user->is_user;