X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fbadword.pl;h=947f70a4dd78e87d7758beef62ee516c9bcec86f;hb=606b9690c7bb9e293cb4a03507f0280eea05d9ce;hp=0b5bbec3a84828feb77e9222b8c248dfc23ce5fd;hpb=c3505bcfc922cd712bad2c20b3479cf8d1dc54fe;p=spider.git diff --git a/cmd/show/badword.pl b/cmd/show/badword.pl index 0b5bbec3..947f70a4 100644 --- a/cmd/show/badword.pl +++ b/cmd/show/badword.pl @@ -6,5 +6,33 @@ # # my ($self, $line) = @_; -return $BadWords::badword->show(1, $self); +return (1, $self->msg('e5')) if $self->remotecmd; +# are we permitted? +return (1, $self->msg('e5')) if $self->priv < 6; +my @out; +my @l; +my $count = 0; + +if ($line =~ /^\s*full/i) { + foreach my $w (BadWords::list_regex(1)) { + ++$count; + push @out, $w; + } +} +else { + foreach my $w (BadWords::list_regex()) { + ++$count; + if (@l >= 5) { + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l; + @l = (); + } + push @l, $w; + } + push @l, "" while @l < 5; + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l; +} + +push @out, "$count BadWords"; + +return (1, @out);