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/../lib";
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 print "\################################################################################\n";
40 print "\# MAPS:\t\tMail Authorization and Permission System (MAPS)\n";
41 print "\# $type.list:\t${Userid}'s $type.list file\n";
42 print "\# Exported:\t" . localtime . "\n";
44 print "\# Copyright 2001-" . $year . ", Andrew\@DeFaria.com, all rights reserved.\n";
46 print "\################################################################################\n";
53 while (my $rec = GetList) {
54 $rec->{pattern} //= '';
55 $rec->{domain} //= '';
56 $rec->{comment} //= '';
57 $rec->{hit_count} //= 0;
58 $rec->{last_hit} //= '';
59 $rec->{retention} //= '';
61 if ($rec->{domain} eq '') {
62 print "$rec->{pattern},$rec->{comment},$rec->{hit_count},$rec->{last_hit},$rec->{retention}\n";
64 print "$rec->{pattern}\@$rec->{domain},$rec->{comment},$rec->{hit_count},$rec->{last_hit},$rec->{retention}\n";
75 -type => "application/octet-stream",
76 -attachment => "$type.list",