X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=8e17cfa875c251dbb2c850bc4d636bd48b2fffe0;hb=579810d363939640538f88a9caa86e01fe9c7709;hp=78daffe263483b32d53a405c154ee696adadac47;hpb=5b803645eaf1a462937d7cde0e9459f1a6d3f10e;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 78daffe2..8e17cfa8 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -104,11 +104,34 @@ sub dequeue if (is_callsign($msg) && $msg !~ m|/| ) { my $sort = $conn->{csort}; $sort = 'local' if $conn->{peerhost} eq "127.0.0.1"; - $conn->to_connected($msg, 'A', $sort); + my $uref; + if ($main::passwdreq || ($uref = DXUser->get_current($msg)) && $uref->passwd ) { + $conn->conns($msg); + $conn->{state} = 'WP'; + $conn->{decho} = $conn->{echo}; + $conn->{echo} = 0; + $conn->send_raw('password: '); + } else { + $conn->to_connected($msg, 'A', $sort); + } } else { $conn->send_now("Sorry $msg is an invalid callsign"); $conn->disconnect; } + } elsif ($conn->{state} eq 'WP' ) { + my $uref = DXUser->get_current($conn->{call}); + $msg =~ s/[\r\n]+$//; + if ($uref && $msg eq $uref->passwd) { + my $sort = $conn->{csort}; + $conn->{echo} = $conn->{decho}; + delete $conn->{decho}; + $sort = 'local' if $conn->{peerhost} eq "127.0.0.1"; + $conn->{usedpasswd} = 1; + $conn->to_connected($conn->{call}, 'A', $sort); + } else { + $conn->send_now("Sorry"); + $conn->disconnect; + } } elsif ($conn->{state} eq 'WC') { if (exists $conn->{cmd} && @{$conn->{cmd}}) { $conn->_docmd($msg);