add privilege checks to (un)set/show/bad* cmds
authorDirk Koopman <djk@tobit.co.uk>
Sat, 10 May 2008 14:26:57 +0000 (15:26 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 10 May 2008 14:26:57 +0000 (15:26 +0100)
These commands now require at least privilege 6 and cannot be done
remotely.

16 files changed:
Changes
cmd/Commands_en.hlp
cmd/set/baddx.pl
cmd/set/badnode.pl
cmd/set/badspotter.pl
cmd/set/badword.pl
cmd/show/baddx.pl
cmd/show/badnode.pl
cmd/show/badspotter.pl
cmd/show/badword.pl
cmd/unset/baddx.pl
cmd/unset/badnode.pl
cmd/unset/badspotter.pl
cmd/unset/badword.pl
perl/DXProtHandle.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 2bb8b5278b43b4e757dfc16f6cffb08a3d3ac533..446b8752d6b02abfa01eebd2a3558d7418e29495 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+10May08=======================================================================
+1. add some privileges to (un)set/bad* and show/bad* commands. Thanks to
+Mauro IV3SCP for pointing this out to me.
 06May08=======================================================================
 1. Finally made the incompatible change of changing DXUser->get* to
 DXUser::get*. This will break any third party addons or commands use these
index c86d3119316e5d79fbbe7fbb967f215be5c7220e..f1f26cc1ee471943ccb9560d04331b5a13297548 100644 (file)
@@ -1404,8 +1404,8 @@ allows you to see them again. This is the default.
 
 === 5^SET/ARCLUSTER <call> [<call>..]^Make the callsign an AR-Cluster node
 
-=== 8^SET/BADDX <call>..^Stop callsigns in a dx spot being propagated
-=== 8^UNSET/BADDX <call>..^Propagate a dx spot with this callsign again
+=== 6^SET/BADDX <call>..^Stop callsigns in a dx spot being propagated
+=== 6^UNSET/BADDX <call>..^Propagate a dx spot with this callsign again
 Setting a word as 'baddx' will prevent spots with that word in the
 'spotted' field (as in: DX 14001.1 FR0G)of a DX spot from going any
 further. They will not be displayed and they will not be sent onto
@@ -1419,8 +1419,8 @@ To allow a word again, use the following command ...
 
   unset/baddx VIDEO
 
-=== 8^SET/BADNODE <call>..^Stop spots from this node being propagated
-=== 8^UNSET/BADNODE <call>..^Allow spots from this node again
+=== 6^SET/BADNODE <call>..^Stop spots from this node being propagated
+=== 6^UNSET/BADNODE <call>..^Allow spots from this node again
 Setting a callsign as a 'badnode' will prevent spots from that node 
 going any further. They will not be displayed and they will not be 
 sent onto other nodes.
@@ -1438,8 +1438,8 @@ will allow spots from him again.
 
 Use with extreme care. This command may well be superceeded by FILTERing.
 
-=== 8^SET/BADSPOTTER <call>..^Stop spots from this callsign being propagated
-=== 8^UNSET/BADSPOTTER <call>..^Allow spots from this callsign again
+=== 6^SET/BADSPOTTER <call>..^Stop spots from this callsign being propagated
+=== 6^UNSET/BADSPOTTER <call>..^Allow spots from this callsign again
 Setting a callsign as a 'badspotter' will prevent spots from this callsign 
 going any further. They will not be displayed and they will not be 
 sent onto other nodes.
@@ -1462,8 +1462,8 @@ Use with extreme care. This command may well be superceded by FILTERing.
 This command will also stop TALK and ANNOUNCE/FULL from any user marked
 as a BADSPOTTER.
 
-=== 8^SET/BADWORD <word>..^Stop things with this word being propagated
-=== 8^UNSET/BADWORD <word>..^Propagate things with this word again
+=== 6^SET/BADWORD <word>..^Stop things with this word being propagated
+=== 6^UNSET/BADWORD <word>..^Propagate things with this word again
 Setting a word as a 'badword' will prevent things like spots,
 announces or talks with this word in the the text part from going any
 further. They will not be displayed and they will not be sent onto
index 319e09efad4e92b4ad282b3e16732d1955ab8078..c62e5e315984e288422bdf8ce7b1b376259f5088 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::baddx->set(8, $self->msg('e6'), $self, $line);
 
index abdd2e2b872e9c9518cd472f562d361544d2dd2c..b123ef96d625e564ada6857cffb49a0bcb6d5052 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badnode->set(8, $self->msg('e12'), $self, $line);
 
index 645e217e31004a2f35cdec92da2f8bf64fd1bfca..0df3717137c7d072a38cbb63eeb6c6176cb4e295 100644 (file)
@@ -6,6 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
 $line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badspotter->set(8, $self->msg('e6'), $self, $line);
 
index 7df13cff6a0b61cf89de642e8f5a60d95d5c547e..2879388f4f921aa1574d78ae88545ef1b37b4282 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $BadWords::badword->set(8, $self->msg('e6'), $self, $line);
 
index 7780e46bbdad3c7f2b1db2f2b85a210a503d3dfe..49133c514b9340a5b9b79a7176ea093bef09e4d1 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::baddx->show(1, $self);
 
index f8aa263c2f53ac98b6bf493a44ee552613ed4151..e569365175bc16222f3f875c514a9078b11afb8d 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badnode->show(1, $self);
 
index 272e74c3250a20a571d2ee888b6c2f1ae702c4c1..472d15d5db6782c7a5e07de106569d41fa042593 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badspotter->show(1, $self);
 
index 0b5bbec3a84828feb77e9222b8c248dfc23ce5fd..a2b4ce86cbf690aed4cbdbfa7daf187181ef1d02 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $BadWords::badword->show(1, $self);
 
index 58760050b82145509b62b0e7d7220991bed6b9f3..84d4d5fec949258b4708ef38bbd5fcaa284ef50e 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::baddx->unset(8, $self->msg('e6'), $self, $line);
 
index 12f143abceda212bc42606560d0da646dcd2f531..cd44a0aaa1ce04f8dfc3fc9593f43f8ba855afab 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badnode->unset(8, $self->msg('e12'), $self, $line);
 
index 8259133bb048534f6f8297e1671f0a1be4d312aa..20c5569f0c3d680c2d87e5d46b9b34a34a82e6d1 100644 (file)
@@ -6,6 +6,10 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 $line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $DXProt::badspotter->unset(8, $self->msg('e6'), $self, $line);
 
index 6a38d775c53fdd7a0446417ad0971d010d0fbba6..d2b7fe3153720c9328d4ada1e9b271fcaa7c2571 100644 (file)
@@ -6,5 +6,9 @@
 #
 #
 my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+# are we permitted?
+return (1, $self->msg('e5')) if $self->priv < 6;
+$line = join(' ', map {s|[/-]\d+$||; $_} split(/\s+/, $line));
 return $BadWords::badword->unset(8, $self->msg('e6'), $self, $line);
 
index e7160d7cb7148b0e59e5a809cd63258163f0e7b4..f2d5b55946366deb2789f950d3e087ce974ea8bd 100644 (file)
@@ -1709,7 +1709,7 @@ sub handle_92
                }
 
        } elsif ($sort eq 'K') {
-               $pc92Kin += length $line if $sort eq 'K';
+               $pc92Kin += length $line;
 
                # remember the last channel we arrived on
                $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
index b5ad051aa4eb611fa7268fce15657b61a3d0ae69..34f9aaff27e4bf953f3369911c12ecdd5006965e 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.55';
 $subversion = '0';
-$build = '5';
+$build = '6';
 
 1;