+08Nov21=======================================================================
+1. Get to the bottom of why ssid'd calls were using the base call's
+ credentials. This should now work as expected.
06Nov21=======================================================================
1. Improve console.pl scrolling. Split long lines (eg on announcements.
04Nov21=======================================================================
my @f = split /\s+/, $line;
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
return (1, $self->msg('e9')) if !@f;
-return (1, $self->msg('e28')) unless $self->registered;
+return (1, $self->msg('e28')) unless $self->isregistered;
my $sort = uc $f[0];
my $to = '*';
my @f = split /\s+/, $line, 2;
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
return (1, $self->msg('e34')) unless @f >= 1;
-return (1, $self->msg('e28')) unless $self->registered;
+return (1, $self->msg('e28')) unless $self->isregistered;
my $target = uc $f[0];
my $localonly;
my $oline = $line;
+#$DB::single=1;
+
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
-return (1, $self->msg('e28')) unless $self->registered;
+return (1, $self->msg('e28')) unless $self->isregistered;
my @bad;
if (@bad = BadWords::check($line)) {
my $addr = $self->hostname;
if ($self->conn && $self->conn->peerhost) {
- $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/;
+# $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/;
+ $ipaddr = $addr; # force a PC61
} elsif ($self->inscript) {
$ipaddr = "script";
}
if ($ipaddr) {
$spot = DXProt::pc61($spotter, $freq, $spotted, $line, $ipaddr);
- } else {
- $spot = DXProt::pc11($spotter, $freq, $spotted, $line);
}
+ #else {
+ # $spot = DXProt::pc11($spotter, $freq, $spotted, $line);
+ #}
$self->dx_spot(undef, undef, @spot);
if ($self->isslugged) {
@extra = ();
}
- return (1, $self->msg('e28')) unless $self->registered || $to eq $main::myalias;
+ return (1, $self->msg('e28')) unless $self->isregistered || $to eq $main::myalias;
$loc->{to} = [ $to, @extra ]; # to is an array
$loc->{subject} = $oref->subject;
# any thing after send?
return (1, $self->msg('e6')) if !@f;
- return (1, $self->msg('e28')) unless $self->registered || uc $f[0] eq $main::myalias;
+ return (1, $self->msg('e28')) unless $self->isregistered || uc $f[0] eq $main::myalias;
while (@f) {
my $f = uc shift @f;
}
my @l;
+ push @out, "Registration is " . ($main::reqreg ? "Required" : "NOT Required");
foreach my $call (@val) {
if (@l >= 5) {
push @out, sprintf "%-14s %-14s %-14s %-14s %-14s", @l;
$to = uc $to;
return (1, $self->msg('e22', $to)) unless is_callsign($to);
-return (1, $self->msg('e28')) unless $self->registered || $to eq $main::myalias;
+return (1, $self->msg('e28')) unless $self->isregistered || $to eq $main::myalias;
$via = uc $via if $via;
my $call = $via || $to;
my $tonode;
my $via;
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
-return (1, $self->msg('e28')) unless $self->registered;
+return (1, $self->msg('e28')) unless $self->isregistered;
if ($sort eq "FULL") {
$line =~ s/^$f[0]\s+//; # remove it
$user->wantusstate(0) unless defined $user->{wantusstate};
# sort out registration
- if ($main::reqreg == 1) {
- $self->{registered} = $user->registered;
- } elsif ($main::reqreg == 2) {
+ if ($main::reqreg == 2) {
$self->{registered} = !$user->registered;
} else {
- $self->{registered} = 1;
- }
+ $self->{registered} = $user->registered;
+ }
# establish slug queue, if required
$self->{sluggedpcs} = [];
$comment = substr($comment, 0, $clth-3) . ' ' . $_[12] if $_[12];
}
- return sprintf "DX de %-9.9s%9.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment;
+ return sprintf "DX de %-8.8s%10.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment;
}
my $self = shift;
my $motd;
- unless ($self->{registered}) {
+ unless ($self->isregistered) {
$motd = "${main::motd}_nor_$self->{lang}";
$motd = "${main::motd}_nor" unless -e $motd;
}
{
return ($users, $maxusers);
}
+
+sub isregistered
+{
+ my $self = shift;
+
+ # the sysop is registered!
+ return 1 if $self->call eq $main::myalias || $self->call eq $main::mycall;
+
+ if ($main::reqreg) {
+ return $self->{registered};
+ } else {
+ return 1;
+ }
+}
+
1;
__END__
$lock = $user->lockout;
} elsif ($basecall ne $call) {
# if there isn't a SSID on the $call, then try the base
- $user = DXUser::get_current($basecall);
- $lock = $user->lockout if $user;
+ my $luser = DXUser::get_current($basecall);
+ $lock = $luser->lockout if $luser;
}
# now deal with the lock
do_initscr();
$inscroll = 0;
- dbg("resize: l=$lines c=$cols");
- dbg("resize: sh=". scalar @sh );
-# my @tsh;
-# my $t;
-# while (defined ($t = shift @sh)) {
-# dbg("t: $t(" , length $t . ')');
-# if ($t =~ /^\t/) {
-# $t =~ s/^\t/ /;
-# push(@tsh, pop(@tsh) . $t)
-# } else {
-# push(@tsh, $t);
-# }
-# dbg("tsh: " . scalar @tsh);
-# }
-# dbg("resize: tsh=". scalar @tsh );
-# $spos = @tsh < $pagel ? 0 : @tsh - $pagel;
- # addtotop(@tsh);
$spos = @sh < $pagel ? 0 : @sh - $pagel;
show_screen();
$conn->send_later("C$call|$cols") if $conn;
}
}
-# measure the no of screen lines a line will take
-sub measure
-{
- my $line = shift;
- return 0 unless $line;
-
- my $l = length $line;
- my $lines = int ($l / $cols);
- $lines++ if $l / $cols > $lines;
- return $lines;
-}
# display the top screen
sub show_screen
dbg("B: s:$spos h:" . scalar @sh) if isdbg('console');
my ($i, $l);
-# for ($i = 0; $i < $pagel && $p >= 0; ) {
-# $l = measure($sh[$p]);
-# $i += $l;
-# $p-- if $i < $pagel;
- # }
$spos = 0 if $spos < 0;
my $y = $spos;
$top->clrtobot();
for ($i = 0; $i < $pagel && $y < @sh; ++$y) {
my $line = $sh[$y];
-# my $lines = measure($line);
my $lines = 1;
$top->move($i, 0);
dbg("C: s:$spos y:$i sh:" . scalar @sh . " l:" . length($line) . " '$line'") if isdbg('console');
$bot->clrtoeol();
$bot->addstr(substr($inbuf, 0, $cols));
- # add it to the monitor window
-# unless ($spos == @sh) {
-# $spos = @sh;
-# show_screen();
-# }
if ($inscroll && $spos < @sh) {
$spos = @sh - $pagel;
$inscroll = 0;
}
} elsif ($r eq KEY_PPAGE || $r eq "\032") {
if ($spos > 0 && @sh > $pagel) {
-# my ($i, $l);
-# for ($i = 0; $i < $pagel-1 && $spos >= 0; ) {
-# $l = measure($sh[$spos]);
-# $i += $l;
-# --$spos if $i <= $pagel;
-# }
$spos -= $pagel+int($pagel/2);
$spos = 0 if $spos < 0;
$inscroll = 1;
}
} elsif ($r eq KEY_NPAGE || $r eq "\026") {
if ($inscroll && $spos < @sh) {
-# my ($i, $l);
-# for ($i = 0; $i <= $pagel && $spos < @sh; ) {
-# $l = measure($sh[$spos]);
-# $i += $l;
-# ++$spos if $i <= $pagel && $spos < @sh;
-# }
dbg("NPAGE sp:$spos $sh:". scalar @sh . " pl: $pagel") if isdbg('console');
$spos += int($pagel/2);