nailed set/unset parameters in user file
authordjk <djk>
Sun, 21 Nov 1999 18:55:28 +0000 (18:55 +0000)
committerdjk <djk>
Sun, 21 Nov 1999 18:55:28 +0000 (18:55 +0000)
fixed ? replicating in dx remarks

16 files changed:
Changes
cmd/dx.pl
cmd/set/announce.pl
cmd/set/beep.pl
cmd/set/dx.pl
cmd/set/talk.pl
cmd/set/wwv.pl
cmd/set/wx.pl
cmd/stat/user.pl
cmd/unset/announce.pl
cmd/unset/beep.pl
cmd/unset/dx.pl
cmd/unset/talk.pl
cmd/unset/wwv.pl
cmd/unset/wx.pl
perl/DXUser.pm

diff --git a/Changes b/Changes
index 01abe248bd34eefb36e32453cad927c9a3986e26..8c9494aea0c1beb41fdd268b47f659eb847b1bb2 100644 (file)
--- 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.
index 98338ec60986b731439d610605fe82e58f0368c1..c946d76107b6a70f46ff0bcae4506888711ebe52 100644 (file)
--- 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;
index dd6240476579e16d96b3b9dff18349b4de7c2b77..323ff5e07b5000a09d000558e9f1b10256f9ccb4 100644 (file)
@@ -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);
index c198323ee5e9d3da6cfe766316fcbb9a990e7033..7109404b8afe50f292e1bb63355237518c97accc 100644 (file)
@@ -7,4 +7,5 @@
 #
 my $self = shift;
 $self->beep(1);
+$self->user->wantbeep(1);
 return (1, $self->msg('beepon'));
index 0edf6d545d7fd348aab2ed288d9e652552293313..8d599d5e5e81dba128f02f018e194762475a30ba 100644 (file)
@@ -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);
index f24ede719bd06598498f18267fc56d505161d2fd..70bde6e79a468a41dd7e952e4166d1564d24858c 100644 (file)
@@ -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);
index 701a385c4163dd97ba1b8b5cb879c79bf99aa461..d713e48311195c1ec7ccf1c4059ec0c77e22491d 100644 (file)
@@ -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);
index b570a9da32684a0de71e6cb9be28ec0ea1f427c8..f609df353001f6faffd303b8c7de537518dd7913 100644 (file)
@@ -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);
index 997ae542b6bbcf9fe9f5785320396a352c44bf66..61a6e7bf9eb60c156939dbe0285529d71ac2aa8b 100644 (file)
@@ -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);
index 1ff0b548eb8d10ac0156df261f0857239af235bc..2c4ebd30883aa7c5894e6edb3b605b51e7ecc4e8 100644 (file)
@@ -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);
index 0a7c8a16a300bd7dad801f348d1da2ba5c4ebb3a..749029b3b0d42295b8f0b668d2f7aed606e27f4e 100644 (file)
@@ -6,5 +6,6 @@
 # $Id$
 #
 my $self = shift;
+$self->user->wantbeep(0);
 $self->beep(0);
 return (1, $self->msg('beepoff'));
index 62e2a33450560cba3fe559376ba586f588cdb374..dcc177a91562ee7bcbad80311cba9a8bf2addae9 100644 (file)
@@ -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);
index 82b71cde0758e7907f8f51a4affe77f1e0c83f23..77deccbccdc1bcb31ab9180d0b2a3444902e6622 100644 (file)
@@ -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);
index 075338a25e7d7bf770255aad0a1d30848b712f3d..51882a4697ac0da5b83c1fdc92ffc945f7213a5c 100644 (file)
@@ -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);
index 3d874d177455bcede51a699cdb42f54427128607..755ed026c601c4aadd6a23036b4e959edfd36ac0 100644 (file)
@@ -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);
index 0e78af482278a6fbcff41bc8eb2792fd24255327..63dad4f3a0fbe50721fa3213bb33810a2cfd5d2f 100644 (file)
@@ -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