+# do we need to do a login and password job?
+if ($loginreq) {
+ my $user;
+ my $s;
+
+ $connsort = 'telnet' if $connsort eq 'local';
+ setmode();
+
+ if (-e "$data/issue") {
+ open(I, "$data/issue") or die;
+ local $/ = undef;
+ $issue = <I>;
+ close(I);
+ $issue = s/\n/\r/og if $mode == 1;
+ local $/ = $nl;
+ $stdout->print($issue) if $issue;
+ }
+
+ # 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
+ alarm($timeout);
+
+ $stdout->print('login: ');
+ $stdout->flush();
+ local $\ = $mynl;
+ $s = $stdin->getline();
+ chomp $s;
+ $s =~ s/\s+//og;
+ $s =~ s/-\d+$//o; # no ssids!
+ cease(0) unless $s && $s gt ' ';
+ unless (iscallsign($s)) {
+ $stdout->print("Sorry, $s is an invalid callsign");
+ cease(0);
+ }
+ $call = uc $s;
+ alarm(0);
+}
+