From: Dirk Koopman Date: Thu, 21 May 2020 13:23:55 +0000 (+0100) Subject: fix allowmultiple for real user with ssid X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=c87f5c87d207de16008d38561a7bc547a10ea62b;p=spider.git fix allowmultiple for real user with ssid and put back the missing code in DXUser::close to record login times which allow multiple users to work in the first place! --- diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index 691c4101..b0b723ce 100644 --- a/perl/DXDebug.pm +++ b/perl/DXDebug.pm @@ -87,7 +87,7 @@ my $_isdbg; # current dbg level we are processing sub dbg($) { - return unless $fp; +# return unless $fp; my $t = time; for (@_) { my $r = $_; @@ -103,7 +103,7 @@ sub dbg($) shift @dbgring while (@dbgring > $dbgringlth); push @dbgring, $str; } - $fp->writeunix($t, $str) unless $dbglevel{"nolog$_isdbg"}; + $fp->writeunix($t, $str) unless !$fp || $dbglevel{"nolog$_isdbg"} ; } } $_isdbg = ''; diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 5e8f2dfa..85a22195 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -474,7 +474,10 @@ sub close my $ip = shift; $self->{lastin} = $main::systime; # add a record to the connect list -# $self->put(); + my $ref = [$startt || $self->{startt}, $main::systime]; + push @$ref, $ip if $ip; + push @{$self->{connlist}}, $ref; + shift @{$self->{connlist}} if @{$self->{connlist}} > $maxconnlist; } # diff --git a/perl/cluster.pl b/perl/cluster.pl index 5baf0297..9735aa30 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -246,23 +246,28 @@ sub new_channel } # is he locked out ? + $user = DXUser::get_current($call); my $basecall = $call; $basecall =~ s/-\d+$//; # remember this for later multiple user processing - 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; - LogDbg('DXCommand', "$call on $host is locked out, disconnected"); - $conn->disconnect; - return; - } + my $lock; + if ($user) { + # we are a real user + $lock = $user->lockout; + } elsif ($allowmultiple) { + # could we be a potential "pseudo" connection + $user = DXUser::get_current($basecall); + $lock = $user->lockout if $user; + } + if ($lock) { + my $host = $conn->peerhost; + LogDbg('DXCommand', "$call on $host is locked out, disconnected"); + $conn->disconnect; + return; } # set up the basic channel info for "Normal" Users # is there one already connected to me - locally? - $user = DXUser::get_current($call); $dxchan = DXChannel::get($call); my $newcall = $call; if ($dxchan) { @@ -298,7 +303,7 @@ sub new_channel if ($bumpexisting) { my $ip = $dxchan->hostname; $dxchan->send_now('D', DXM::msg($lang, 'conbump', $call, $ip)); - LogDbg('DXCommand', "$call bumped off by $ip, disconnected"); + Log('', "$call bumped off by $ip, disconnected"); $dxchan->disconnect; } else { already_conn($conn, $call, DXM::msg($lang, 'conother', $call, $main::mycall));