From 3f1c5ab45aa13e99da6bea0bfcc6d4434beb5871 Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 31 Jul 2000 20:54:16 +0000 Subject: [PATCH] fixed sh/node improved import_users.pl added some help fixed paging? removed bogus callsign check on PC12 --- Changes | 4 ++++ cmd/Commands_en.hlp | 14 ++++++++++++++ cmd/show/node.pl | 6 ++++-- perl/DXCommandmode.pm | 2 +- perl/DXProt.pm | 2 +- perl/DXUser.pm | 12 +++++++++--- perl/create_sysop.pl | 2 +- perl/import_users.pl | 5 ++++- 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 968fc9ef..c1b9e423 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +31Jul00======================================================================= +1. try to fix paging problem. +2. added help for spoof and set/forward +3. fixed bogus callsign check for field 2 of a PC12 30Jul00======================================================================= 1. Added talk mode so that I don't have to keep typing T all the time. 2. fiddled around with storing of Debug messages a bit more. diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 77025c1a..585811d2 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -300,6 +300,10 @@ delete a command in the local_cmd tree and want to use the normal one again. Execute this command to reset everything back to the state it was just after a cluster restart. +=== 9^LOAD/FORWARD^Reload the msg forwarding routing table +Reload the /spider/msg/forward.pl file if you have changed it +manually whilst the cluster is running. + === 9^LOAD/MESSAGES^Reload the system messages file If you change the /spider/perl/Messages file (usually whilst fiddling/writing new commands) you can have them take effect during a @@ -870,6 +874,16 @@ Display the most recent WWV information that has been received by the system === 5^SHUTDOWN^Shutdown the cluster Shutdown the cluster and disconnect all the users +=== 9^SPOOF ^Do a command as though you are another user +This command is provided so that sysops can set a user's parameters without +me having to write a special 'sysop' version for every user command. It +allows you to pretend that you are doing the command as the user you specify. + +eg:- + + SPOOF G1TLH set/name Dirk + SPOOF G1TLH set/qra JO02LQ + === 5^STAT/DB ^Show the status of a database Show the internal status of a database descriptor. diff --git a/cmd/show/node.pl b/cmd/show/node.pl index 9bc77e2a..9b6938a6 100644 --- a/cmd/show/node.pl +++ b/cmd/show/node.pl @@ -19,17 +19,18 @@ return (1, $self->msg('e5')) unless $self->priv >= 1; my @call = map {uc $_} split /\s+/, $line; my @out; +my $count; # search thru the user for nodes unless (@call) { use DB_File; - my ($action, $count, $key, $data); + my ($action, $key, $data); for ($action = R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = R_NEXT) { if ($data =~ m{sort => '[ACRSX]'}) { push @call, $key; + ++$count; } - ++$count; } } @@ -67,6 +68,7 @@ foreach $call (@call) { } else { push @out, $self->msg('snode2', $pcall, $sort, $ver ? "$major\-$minor.$subs" : " "); } + ++$count; } return (1, @out, $self->msg('rec', $count)); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 4eca6e74..d8f6eb54 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -258,7 +258,7 @@ sub send_ans $line =~ s/\s+$//o; # why am having to do this? $self->send($line); } - $self->{pagedata} = \@_; + $self->{pagedata} = [ @_ ]; $self->state('page'); $self->send($self->msg('page', scalar @_)); } else { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 310416e8..8ca96434 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -315,7 +315,7 @@ sub normal } if ($pcno == 12) { # announces - unless (is_callsign($field[1]) && is_callsign($field[2]) && is_callsign($field[5])) { + unless (is_callsign($field[1]) && is_callsign($field[5])) { dbg('chan', "Corrupt announce, rejected"); return; } diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 49745722..eaf88039 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -8,9 +8,6 @@ package DXUser; -require Exporter; -@ISA = qw(Exporter); - use DXLog; use DB_File; use Data::Dumper; @@ -104,6 +101,15 @@ sub init $filename = $fn; } +sub del_file +{ + my ($pkg, $fn, $mode) = @_; + + confess "need a filename in User" if !$fn; + $fn .= ".v2"; + unlink $fn; +} + use strict; # diff --git a/perl/create_sysop.pl b/perl/create_sysop.pl index 95fc0636..52cd941f 100755 --- a/perl/create_sysop.pl +++ b/perl/create_sysop.pl @@ -23,7 +23,7 @@ use DXUser; sub delete_it { - system("rm -f $userfn*"); + DXUser->del_file($userfn); } sub create_it diff --git a/perl/import_users.pl b/perl/import_users.pl index 7f77a564..159989b8 100755 --- a/perl/import_users.pl +++ b/perl/import_users.pl @@ -20,14 +20,17 @@ BEGIN { use DXVars; use DXUser; +use DXUtil; use Carp; $inpfn = $ARGV[0] if @ARGV; croak "need a input filename" unless $inpfn; +DXUser->del_file($userfn); DXUser->init($userfn, 1); -do "$inpfn"; +my $s = readfilestr "$inpfn"; +eval $s; print $@ if $@; DXUser->finish(); -- 2.34.1