X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Funset%2Fbadword.pl;h=6d49de3afba8df192db4786ce815911d62a734d8;hb=606b9690c7bb9e293cb4a03507f0280eea05d9ce;hp=6a38d775c53fdd7a0446417ad0971d010d0fbba6;hpb=c3505bcfc922cd712bad2c20b3479cf8d1dc54fe;p=spider.git diff --git a/cmd/unset/badword.pl b/cmd/unset/badword.pl index 6a38d775..6d49de3a 100644 --- a/cmd/unset/badword.pl +++ b/cmd/unset/badword.pl @@ -6,5 +6,27 @@ # # my ($self, $line) = @_; -return $BadWords::badword->unset(8, $self->msg('e6'), $self, $line); +return (1, $self->msg('e5')) if $self->remotecmd; +# are we permitted? +return (1, $self->msg('e5')) if $self->priv < 6; + +my @words = split /\s+/, uc $line; +my @out; +my $count = 0; +foreach my $w (@words) { + my @in; + + unless (@in = BadWords::check($w)) { + push @out, "BadWord $w not defined, ignored"; + } else { + @in = BadWords::del_regex($w); + push @out, "BadWord $w removed"; + $count++; + } +} +if ($count) { + BadWords::generate_regex(); + BadWords::put(); +} +return (1, @out);