2 # Delete auto-whitelist entries
4 require './spam-lib.pl';
5 &error_setup($text{'dawl_err'});
7 &set_config_file_in(\%in);
9 &can_edit_awl($in{'user'}) || &error($text{'dawl_ecannot'});
10 $conf = &get_config();
13 &open_auto_whitelist_dbm($in{'user'}) || &error($text{'dawl_eopen'});
14 @d = split(/\0/, $in{'d'});
15 @d || &error($text{'dawl_enone'});
19 @d = map { s/\|.*$//; $_ } @d;
20 @from = map { @{$_->{'words'}} } &find("whitelist_from", $conf);
21 @from = &unique(@from, @d);
22 &save_directives($conf, "whitelist_from", \@from, 1);
25 elsif ($in{'black'}) {
27 @d = map { s/\|.*$//; $_ } @d;
28 @from = map { @{$_->{'words'}} } &find("blacklist_from", $conf);
29 @from = &unique(@from, @d);
30 &save_directives($conf, "blacklist_from", \@from, 1);
34 # Delete from AWL hash
37 delete($awl{$d."|totscore"});
41 &close_auto_whitelist_dbm();
42 &redirect("edit_awl.cgi?search=".&urlize($in{'search'}).
43 "&user=".&urlize($in{'user'}).
44 "&file=".&urlize($in{'file'}).
45 "&title=".&urlize($in{'title'}));