2 ################################################################################
4 # File: $RCSfile: exportlist.cgi,v $
5 # Revision: $Revision: 1.1 $
6 # Description: Export an address list
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 ################################################################################
18 local $0 = $FindBin::Script;
20 use lib $FindBin::Bin;
25 use CGI qw/:standard *table/;
26 use CGI::Carp "fatalsToBrowser";
28 my $type = param ("type");
29 my $userid = cookie ("MAPSUser");
30 $userid //= $ENV{USER};
31 my $Userid = ucfirst $userid;
36 my $year = substr ((scalar (localtime)), 20, 4);
38 my ($pattern, $domain, $comment, $hit_count, $last_hit);
39 my $sth = FindList $type;
41 print "\################################################################################\n";
43 print "\# MAPS:\t\tMail Authorization and Permission System (MAPS)\n";
44 print "\# $type.list:\t${Userid}'s $type.list file\n";
45 print "\# Exported:\t" . localtime . "\n";
47 print "\# Copyright 2001-" . $year . ", Andrew\@DeFaria.com, all rights reserved.\n";
49 print "\################################################################################\n";
51 while (($_, $_, $pattern, $domain, $comment, $_, $hit_count, $last_hit) = GetList $sth) {
52 last if !(defined $pattern or defined $domain);
58 print "$pattern,$comment,$hit_count,$last_hit\n";
60 print "$pattern\@$domain,$comment,$hit_count,$last_hit\n";
71 -type => "application/octet-stream",
72 -attachment => "$type.list",