File: mailing_lists_dump.pl

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (28 lines) | stat: -rwxr-xr-x 859 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
#
# $Id: mailing_lists_dump.pl 4059 2005-03-03 21:38:26Z cbayle $
#
# mailing_list_dump.pl - Script to suck data outta the database to be processed on the mail
#                        mail server to create mailing lists
use DBI;

require("../include.pl");  # Include all the predefined functions

my $list_array = ();

&db_connect;

# Dump the Table information
$query = "SELECT users.user_name,mail_group_list.list_name,mail_group_list.password,mail_group_list.is_public FROM mail_group_list,users WHERE mail_group_list.list_admin=users.user_id";
$c = $dbh->prepare($query);
$c->execute();
while(my ($list_name, $list_admin, $password, $status) = $c->fetchrow()) {

	$new_list = "$list_name:$list_admin:$password:$status\n";

	push @list_array, $new_list;
}


# Now write out the files
write_array_file($file_dir."/list_dump", @list_array);