From: djk Date: Sun, 21 Nov 1999 18:55:28 +0000 (+0000) Subject: nailed set/unset parameters in user file X-Git-Tag: R_1_35~3 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe78618f23392a6ae58542b78cc4c8dbc84e71c5;p=spider.git nailed set/unset parameters in user file fixed ? replicating in dx remarks --- diff --git a/Changes b/Changes index 01abe248..8c9494ae 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,14 @@ 1. Added set/unset logininfo which will tell anybody that has this set when someone has either logged in or out of this node. 2. Added set/pinginterval command which alters the length of time between -pings sent to nodes. +pings sent to nodes, the value is minutes < 120 and seconds above that, 0 +means disable pinging (not recommended). +3. If someone does a sysop whilst connected via ax25, don't show privilege +level or passwd in stat/user. +4. Fixed the problem with the dx command where if the callsign ended in a ? +then the call and the freq would be replicated in the remarks. +5. Set/unset ann, dx, talk, beep, wx, wwv all are now permanent (ie stored in +the user file) 19Nov99======================================================================= 1. Added new version of sh/sun and also sh/moon from Steve K9AN 2. Added rtt to who. diff --git a/cmd/dx.pl b/cmd/dx.pl index 98338ec6..c946d761 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -9,7 +9,7 @@ # my ($self, $line) = @_; -my @f = split /\s+/, $line; +my @f = split /\s+/, $line, 3; my $spotter = $self->call; my $spotted; my $freq; @@ -26,8 +26,8 @@ return (1, $self->msg('dx2')) unless @f >= 2; if ($f[0] =~ /^by$/i) { $spotter = uc $f[1]; $line =~ s/^\s*$f[0]\s+$f[1]\s+//; - shift @f; - shift @f; + $line = $f[2]; + @f = split /\s+/, $line; return (1, $self->msg('dx2')) unless @f >= 2; } @@ -41,7 +41,10 @@ if ($f[0] =~ /[A-Za-z]/) { } else { return (1, $self->msg('dx2')); } -$line =~ s/^$f[0]\s+$f[1]\s*//; + +# make line the rest of the line +$line = $f[2]; +@f = split /\s+/, $line; # bash down the list of bands until a valid one is reached my $bandref; diff --git a/cmd/set/announce.pl b/cmd/set/announce.pl index dd624047..323ff5e0 100644 --- a/cmd/set/announce.pl +++ b/cmd/set/announce.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->ann(1); + $chan->user->wantann(1); push @out, $self->msg('anns', $call); } else { push @out, $self->msg('e3', "Set Announce", $call); diff --git a/cmd/set/beep.pl b/cmd/set/beep.pl index c198323e..7109404b 100644 --- a/cmd/set/beep.pl +++ b/cmd/set/beep.pl @@ -7,4 +7,5 @@ # my $self = shift; $self->beep(1); +$self->user->wantbeep(1); return (1, $self->msg('beepon')); diff --git a/cmd/set/dx.pl b/cmd/set/dx.pl index 0edf6d54..8d599d5e 100644 --- a/cmd/set/dx.pl +++ b/cmd/set/dx.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->dx(1); + $chan->user->wantdx(1); push @out, $self->msg('dxs', $call); } else { push @out, $self->msg('e3', "Set DX Spots", $call); diff --git a/cmd/set/talk.pl b/cmd/set/talk.pl index f24ede71..70bde6e7 100644 --- a/cmd/set/talk.pl +++ b/cmd/set/talk.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->talk(1); + $chan->user->wanttalk(1); push @out, $self->msg('talks', $call); } else { push @out, $self->msg('e3', "Set Talk", $call); diff --git a/cmd/set/wwv.pl b/cmd/set/wwv.pl index 701a385c..d713e483 100644 --- a/cmd/set/wwv.pl +++ b/cmd/set/wwv.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->wwv(1); + $chan->user->wantwwv(1); push @out, $self->msg('wwvs', $call); } else { push @out, $self->msg('e3', "Set WWV", $call); diff --git a/cmd/set/wx.pl b/cmd/set/wx.pl index b570a9da..f609df35 100644 --- a/cmd/set/wx.pl +++ b/cmd/set/wx.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->wx(1); + $chan->user->wantwx(1); push @out, $self->msg('wxs', $call); } else { push @out, $self->msg('e3', "Set WX Spots", $call); diff --git a/cmd/stat/user.pl b/cmd/stat/user.pl index 997ae542..61a6e7bf 100644 --- a/cmd/stat/user.pl +++ b/cmd/stat/user.pl @@ -5,20 +5,24 @@ # my ($self, $line) = @_; -my @list = split /\s+/, $line; # generate a list of callsigns -@list = ($self->call) if !@list; # my channel if no callsigns +my @list = split /\s+/, $line; # generate a list of callsigns +@list = ($self->call) if !@list; # my channel if no callsigns my $call; my @out; foreach $call (@list) { - $call = uc $call; - my $ref = DXUser->get_current($call); - if ($ref) { - @out = print_all_fields($self, $ref, "User Information $call"); - } else { - push @out, "User: $call not found"; - } - push @out, "" if @list > 1; + $call = uc $call; + my $ref = DXUser->get_current($call); + if ($ref) { + if ($self->consort eq 'ax25') { + @out = grep { !/(Password|Privilege)/ } print_all_fields($self, $ref, "User Information $call"); + } else { + @out = print_all_fields($self, $ref, "User Information $call"); + } + } else { + push @out, "User: $call not found"; + } + push @out, "" if @list > 1; } return (1, @out); diff --git a/cmd/unset/announce.pl b/cmd/unset/announce.pl index 1ff0b548..2c4ebd30 100644 --- a/cmd/unset/announce.pl +++ b/cmd/unset/announce.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->ann(0); + $chan->user->wantann(0); push @out, $self->msg('annu', $call); } else { push @out, $self->msg('e3', "Unset Announce", $call); diff --git a/cmd/unset/beep.pl b/cmd/unset/beep.pl index 0a7c8a16..749029b3 100644 --- a/cmd/unset/beep.pl +++ b/cmd/unset/beep.pl @@ -6,5 +6,6 @@ # $Id$ # my $self = shift; +$self->user->wantbeep(0); $self->beep(0); return (1, $self->msg('beepoff')); diff --git a/cmd/unset/dx.pl b/cmd/unset/dx.pl index 62e2a334..dcc177a9 100644 --- a/cmd/unset/dx.pl +++ b/cmd/unset/dx.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->dx(0); + $chan->user->wantdx(0); push @out, $self->msg('dxu', $call); } else { push @out, $self->msg('e3', "Unset DX Spots", $call); diff --git a/cmd/unset/talk.pl b/cmd/unset/talk.pl index 82b71cde..77deccbc 100644 --- a/cmd/unset/talk.pl +++ b/cmd/unset/talk.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->talk(0); + $chan->user->wanttalk(0); push @out, $self->msg('talku', $call); } else { push @out, $self->msg('e3', "Unset Talk", $call); diff --git a/cmd/unset/wwv.pl b/cmd/unset/wwv.pl index 075338a2..51882a46 100644 --- a/cmd/unset/wwv.pl +++ b/cmd/unset/wwv.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->wwv(0); + $chan->user->wantwwv(0); push @out, $self->msg('wwvu', $call); } else { push @out, $self->msg('e3', "Unset WWV", $call); diff --git a/cmd/unset/wx.pl b/cmd/unset/wx.pl index 3d874d17..755ed026 100644 --- a/cmd/unset/wx.pl +++ b/cmd/unset/wx.pl @@ -18,6 +18,7 @@ foreach $call (@args) { my $chan = DXChannel->get($call); if ($chan) { $chan->wx(0); + $chan->user->wantwx(0); push @out, $self->msg('wxu', $call); } else { push @out, $self->msg('e3', "Unset WX Spots", $call); diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 0e78af48..63dad4f3 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -44,8 +44,8 @@ $filename = undef; node => '0,Last Node', homenode => '0,Home Node', lockout => '9,Locked out?,yesno', # won't let them in at all - dxok => '9,DX Spots?,yesno', # accept his dx spots? - annok => '9,Announces?,yesno', # accept his announces? + dxok => '9,Accept DX Spots?,yesno', # accept his dx spots? + annok => '9,Accept Announces?,yesno', # accept his announces? reg => '0,Registered?,yesno', # is this user registered? lang => '0,Language', hmsgno => '0,Highest Msgno', @@ -123,8 +123,8 @@ sub new my $self = bless {}, $pkg; $self->{call} = $call; $self->{'sort'} = 'U'; - $self->{dxok} = 1; - $self->{annok} = 1; + $self->{dxok} = '1'; + $self->{annok} = '1'; $self->{lang} = $main::lang; $self->put; return $self; @@ -328,8 +328,8 @@ sub _want my $self = shift; my $val = shift; my $s = "want$n"; - $self->{$n} = $val if $val; - return exists $self->{$n} ? $self->{$n} : 1; + $self->{$s} = $val if defined $val; + return exists $self->{$s} ? $self->{$s} : 1; } sub wantbeep