X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=db3bb80a1b720be88880cd3b5323c0d2e1e5410d;hb=295f32fa75fefedcf1cd980c5afcc5de08417ba9;hp=9f39fdd135c42e22cc1a2249528e06edfaf6fdb4;hpb=0f0ab4da54a368d833269bb816614b2adae97842;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index 9f39fdd1..db3bb80a 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -41,6 +41,7 @@ BEGIN { use Msg; use DXVars; use DXDebug; +use DXUtil; use Net::Telnet qw(TELOPT_ECHO); use IO::File; use IO::Socket; @@ -378,42 +379,22 @@ if ($loginreq) { $stdout->print($issue) if $issue; } - - use DXUser; - - DXUser->init($userfn); - # allow a login from an existing user. I could create a user but # I want to check for valid callsigns and I don't have the # necessary info / regular expression yet - for ($state = 0; $state < 2; ) { - alarm($timeout); + alarm($timeout); - if ($state == 0) { - $stdout->print('login: '); - $stdout->flush(); - local $\ = $nl; - $s = $stdin->getline(); - chomp $s; - $s =~ s/\s+//og; - $s =~ s/-\d+$//o; # no ssids! - cease(0) unless $s gt ' '; - $call = uc $s; - $user = DXUser->get($call); - $state = 1; - } elsif ($state == 1) { - $stdout->print('password: '); - $stdout->flush(); - local $\ = $nl; - $s = $stdin->getline(); - chomp $s; - $state = 2; - if (!$user || ($user->passwd && $user->passwd ne $s)) { - $stdout->print("sorry...$nl"); - cease(0); - } - } - } + $stdout->print('login: '); + $stdout->flush(); + local $\ = $nl; + $s = $stdin->getline(); + chomp $s; + $s =~ s/\s+//og; + $s =~ s/-\d+$//o; # no ssids! + cease(0) unless $s gt ' ' && iscallsign($s); + $call = uc $s; + $connsort = 'telnet' if $connsort eq 'local'; + alarm(0); } # handle callsign and connection type firtling