back port registration from mojo

This commit is contained in:
Dirk Koopman 2021-12-10 10:45:23 +00:00
parent 23b5ee57c8
commit ec2bc54f84
5 changed files with 20 additions and 16 deletions

View File

@ -1,5 +1,6 @@
08Dec21=======================================================================
1. Backport console.pl scrolling and width management changes.
2. Backport show/registered cmd format from mojo.
06Dec21=======================================================================
1. Fix show/register to allow query of individual calls as well as get a
complete list.

View File

@ -21,7 +21,7 @@ while ($f = shift @f) { # next field
next if $from && $to > $from;
}
unless ($to) {
($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
($to) = $f =~ /^(\d+)$/ if !$to; # is it a to count?
next if $to;
}
unless ($who) {

View File

@ -36,13 +36,15 @@ unless (keys %call) {
foreach $key (sort keys %call) {
my $u = DXUser::get_current($key);
if ($u && $u->registered) {
push @val, $key;
if ($u && defined (my $r = $u->registered)) {
push @val, "${key}($r)";
++$count;
}
}
my @l;
push @out, "Registration is " . ($main::reqreg ? "Required" : "NOT Required");
foreach my $call (@val) {
if (@l >= 5) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;

View File

@ -746,6 +746,20 @@ sub handle_xml
return $r;
}
sub registered
{
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;
}
}
#no strict;
sub AUTOLOAD
{

View File

@ -1251,19 +1251,6 @@ sub send_motd
$self->send_file($motd) if -e $motd;
}
sub registered
{
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__