From 5275b86607057a0960cdf03b41b8092a3d813e57 Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 3 Sep 2001 23:13:10 +0000 Subject: [PATCH] add delete/user command --- Changes | 2 ++ cmd/Aliases | 3 ++- cmd/Commands_en.hlp | 4 ++++ cmd/delete/user.pl | 35 +++++++++++++++++++++++++++++++++++ cmd/load/baddx.pl | 8 -------- perl/DXChannel.pm | 1 + perl/Messages | 9 +++++---- 7 files changed, 49 insertions(+), 13 deletions(-) delete mode 100644 cmd/load/baddx.pl diff --git a/Changes b/Changes index 95a06473..a4314b53 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +04Sep01======================================================================= +1. add delete/user command 03Sep01======================================================================= 1. make spot dups look back 5 mins. 2. strip the top off each character in any text field of a Spot for duping. diff --git a/cmd/Aliases b/cmd/Aliases index f6b8408a..cedd261b 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -35,8 +35,9 @@ package CmdAlias; 'c' => [ ], 'd' => [ - '^del', 'kill', 'kill', + '^del\w*/u', 'delete/user', 'delete/user', '^del\w*/fu', 'kill full', 'kill', + '^del', 'kill', 'kill', '^di\w*/a\w*', 'directory all', 'directory', '^di\w*/b\w*', 'directory bulletins', 'directory', '^di\w*/n\w*', 'directory new', 'directory', diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index f5ede28a..554c85c3 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -260,6 +260,10 @@ DX cluster . This process creates a new 'client' process which will use the script in /spider/connect/ to effect the 'chat' exchange necessary to traverse the network(s) to logon to the cluster . +=== 9^DELELE/USER ...^Delete this user from the User Database +This command will completely remove a one or more users from the database. +It goes without saying that you should use this command CAREFULLY! + === 0^DBAVAIL^Show a list of all the Databases in the system Title says it all really, this command lists all the databases defined in the system. It is also aliased to SHOW/COMMAND. diff --git a/cmd/delete/user.pl b/cmd/delete/user.pl index e69de29b..ac5a8034 100644 --- a/cmd/delete/user.pl +++ b/cmd/delete/user.pl @@ -0,0 +1,35 @@ +# +# delete a user +# +# Please note that this is only effective if the user is not on-line +# +# Copyright (c) 1998 - Dirk Koopman +# +# $Id$ +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call; +my @out; +my $user; + +return (1, $self->msg('e5')) if $self->priv < 9; + +foreach $call (@args) { + $call = uc $call; + my $chan = DXChannel->get($call); + if ($chan) { + push @out, $self->msg('nodee1', $call); + } else { + $user = DXUser->get($call); + if ($user) { + $user->del; + push @out, $self->msg('deluser', $call); + Log('DXCommand', $self->msg('deluser', $call)); + } else { + push @out, $self->msg('e3', "Delete/User", $call); + } + } +} +return (1, @out); diff --git a/cmd/load/baddx.pl b/cmd/load/baddx.pl deleted file mode 100644 index 64a54c9d..00000000 --- a/cmd/load/baddx.pl +++ /dev/null @@ -1,8 +0,0 @@ -# reload the baddx file -my $self = shift; -my @out; -return (1, $self->msg('e5')) if $self->priv < 9; -do "$main::data/baddx.pl" if -e "$main::data/baddx.pl"; -push @out, $@ if $@; -@out = ($self->msg('ok')) unless @out; -return (1, @out); diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index fc779b0f..8a186e3c 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -102,6 +102,7 @@ $count = 0; enhanced => '5,Enhanced Client,yesno', senddbg => '8,Sending Debug,yesno', width => '0,Column Width', + disconnecting => '9,Disconnecting,yesno', ); use vars qw($VERSION $BRANCH); diff --git a/perl/Messages b/perl/Messages index b6b0f67f..82f0abbd 100644 --- a/perl/Messages +++ b/perl/Messages @@ -27,10 +27,7 @@ package DXM; conscript => 'no connect script called \"$_[0]\" found in $main::root/connect', confail => 'connection to $_[0] failed ($_[1])', constart => 'connection to $_[0] started', - disc1 => 'Disconnected by $_[0]', - disc2 => 'Channel $_[0] disconnected', - disc3 => 'No Channel, but connection $_[0] disconnected', - disc4 => 'No Channel or connection but orphan $_[0] disconnected', + deluser => 'User $_[0] has been deleted', db1 => 'This database is hosted at $_[0]', db2 => 'Sorry, but key: $_[0] was not found in $_[1]', db3 => 'Sorry, database $_[0] doesn\'t exist here', @@ -43,6 +40,10 @@ package DXM; db10 => '$_[0] records imported into $_[1]', db11 => 'Sending your request(s) to $_[0], please stand by...', dfreq1 => 'Invalid freq $_[0] need: eg 0/30000 or hf or hf/cw', + disc1 => 'Disconnected by $_[0]', + disc2 => 'Channel $_[0] disconnected', + disc3 => 'No Channel, but connection $_[0] disconnected', + disc4 => 'No Channel or connection but orphan $_[0] disconnected', done => 'Done', dup => 'Sorry, this is a duplicate', dx1 => 'Frequency $_[0] not in band (see show/band); usage: DX [BY call] freq call comments', -- 2.34.1