5 # The following exit codes are defined and MUST BE CONSISTENT with the
6 # error codes the library uses:
7 $MR_DBMS_ERR = 47836421;
9 $ENV{PATH} = "/bin:/usr/bin:/sbin:/usr/sbin";
11 $outfile = '/moira/dcm/confluence.out';
16 $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
19 open(OUT, ">$outfile");
21 $sth = $dbh->prepare("SELECT l.name, l.gid FROM list l " .
22 "WHERE l.name LIKE 'confluence-%' AND l.active = 1 " .
23 "AND l.grouplist = 1 ORDER by l.name") || exit $MR_DBMS_ERR;
27 while (($name, $gid) = $sth->fetchrow_array) {
28 $sth2 = $dbh->prepare("SELECT UNIQUE i.member_type, i.member_id " .
29 "FROM imembers i, list l " .
30 "WHERE l.name = " . $dbh->quote($name) .
31 "AND i.list_id = l.list_id " .
32 "AND (i.member_type = 'USER' " .
33 "OR i.member_type = 'STRING')") ||
42 while (($type, $id) = $sth2->fetchrow_array) {
43 if ($type eq "USER") {
44 ($member) = $dbh->selectrow_array("SELECT login FROM users " .
48 $member = $member . "\@mit.edu";
50 elsif ($type eq "STRING") {
51 ($member) = $dbh->selectrow_array("SELECT string " .
53 "WHERE string_id = " .
57 $row = "$maybecomma$member";