2 ################################################################################
4 # File: $RCSfile: add2nulllist.cgi,v $
5 # Revision: $Revision: 1.1 $
6 # Description: Add an email address to the nulllist
7 # Author: Andrew@DeFaria.com
8 # Created: Mon Jan 16 20:25:32 PST 2006
9 # Modified: $Date: 2013/06/12 14:05:47 $
12 # (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ################################################################################
19 $0 = $FindBin::Script;
21 use lib "$FindBin::Bin/../lib";
28 use CGI qw/:standard *table/;
29 use CGI::Carp 'fatalsToBrowser';
37 my $nextseq = GetNextSequenceNo($userid, $type);
40 my $pattern = param "pattern$nextseq";
41 my $domain = param "domain$nextseq";
42 my $comment = param "comment$nextseq";
43 my $hit_count = param "hit_count$nextseq";
45 last if ((!defined $pattern || $pattern eq '') &&
46 (!defined $domain || $domain eq ''));
48 $sender = CheckEmail $pattern, $domain;
50 my ($status, $rule) = OnNulllist($sender);
53 print br {-class => 'error'}, "The email address $sender is already on ${Userid}'s $type list";
55 $hit_count ||= CountMsg($sender);
57 Add2Nulllist($sender, $userid, $comment, $hit_count);
59 print br "The email address, $sender, has been added to ${Userid}'s $type list";
61 # Now remove this entry from the other lists (if present)
62 for my $otherlist ('white', 'black') {
63 my $sth = FindList $otherlist, $sender;
64 my ($sequence, $count);
66 ($_, $_, $_, $_, $_, $sequence) = GetList($sth);
69 $count = DeleteList($otherlist, $sequence);
71 print br "Removed $sender from ${Userid}'s " . ucfirst $otherlist . ' list'
74 ResequenceList($userid, $otherlist);
93 NavigationBar($userid);
95 $Userid = ucfirst $userid;
101 -action => 'processaction.cgi',
105 print '<p></p><center>',
106 hidden ({-name => 'type',
108 submit ({-name => 'action',