The new BadWord, all regex, system
[spider.git] / cmd / show / badword.pl
index eddefef86d949f8c13bd0a59fe94e483d1ea7eed..947f70a4dd78e87d7758beef62ee516c9bcec86f 100644 (file)
@@ -3,8 +3,36 @@
 #
 # Copyright (c) 1998 - Dirk Koopman G1TLH
 #
-# $Id$
+#
 #
 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);