]> dxcluster.org Git - spider.git/commitdiff
add delete/user command
authorminima <minima>
Mon, 3 Sep 2001 23:13:10 +0000 (23:13 +0000)
committerminima <minima>
Mon, 3 Sep 2001 23:13:10 +0000 (23:13 +0000)
Changes
cmd/Aliases
cmd/Commands_en.hlp
cmd/delete/user.pl
cmd/load/baddx.pl [deleted file]
perl/DXChannel.pm
perl/Messages

diff --git a/Changes b/Changes
index 95a06473328534080dcfbd440ced43c378e0ce59..a4314b53dd8497692556516ce9f4bf3919f411b6 100644 (file)
--- 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.
index f6b8408ade09202d75d3b8c873734d73c3a428a4..cedd261b3c74fce04abb644aa9322975f186a3b6 100644 (file)
@@ -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',
index f5ede28a305fd425485109ae8a36b5e56f39d3d3..554c85c3d75811477f75c2448cec2d029c3a7cfc 100644 (file)
@@ -260,6 +260,10 @@ DX cluster <callsign>. This process creates a new 'client' process which will
 use the script in /spider/connect/<callsign> to effect the 'chat' exchange
 necessary to traverse the network(s) to logon to the cluster <callsign>.
 
+=== 9^DELELE/USER <callsign> ...^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.
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ac5a803411295b67c695d0d5ce6d50727c651012 100644 (file)
@@ -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 (file)
index 64a54c9..0000000
+++ /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); 
index fc779b0f63ca46172b952610e129621eaa926117..8a186e3c134247e1a38262663518657825f13280 100644 (file)
@@ -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);
index b6b0f67f5ee702de80af7c250b641f6aca139c2c..82f0abbdc96ef9814fa2780ae42aa24f8a3ca619 100644 (file)
@@ -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',