]> andersk Git - moira.git/commitdiff
A DCM for new calendar service, and Makefile.in glue to install it.
authorzacheiss <zacheiss>
Sun, 19 May 2002 21:53:38 +0000 (21:53 +0000)
committerzacheiss <zacheiss>
Sun, 19 May 2002 21:53:38 +0000 (21:53 +0000)
gen/Makefile.in
gen/calendar.gen [new file with mode: 0755]

index 446703ec2c918cad4c4f9c1ada08bb6cd0deb088..40a9b0208f487e976ef7fba78e7692ad7f46f91b 100644 (file)
@@ -42,7 +42,7 @@ TARGET=       acl.gen boot.gen dhcp.gen directory.gen hesiod.gen hosts.gen \
        mailhub.gen ndb.gen network.gen nfs.gen pobox.gen \
        postoffice.gen print.gen warehouse.gen winad.gen www.gen zephyr.gen
 
-SCRIPTS=boot.sh ca.gen dhcp.sh hesiod.sh ip-billing.gen ip-billing.sh \
+SCRIPTS=boot.sh ca.gen calendar.gen dhcp.sh hesiod.sh ip-billing.gen ip-billing.sh \
        longjobs.gen longjobs.sh mailhub.sh ndb.sh nfs.sh null.sh \
        postoffice.sh print.sh sapprint.gen sapprint.sh spwatch.gen \
        stellar.gen stellar.sh warehouse.sh www.sh zephyr.sh \
diff --git a/gen/calendar.gen b/gen/calendar.gen
new file mode 100755 (executable)
index 0000000..4025564
--- /dev/null
@@ -0,0 +1,36 @@
+#!/moira/bin/perl -Tw
+
+# $Id$
+
+# The following exit codes are defined and MUST BE CONSISTENT withh the
+# error codes the library uses:
+$MR_DBMS_ERR = 47836421;
+$MR_OCONFIG = 47836460;
+
+$outfile = '/moira/dcm/calendar.out';
+
+use DBI;
+
+$dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
+    || exit $MR_DBMS_ERR;
+
+$sth = $dbh->prepare("SELECT UNIQUE u.clearid, u.login, u.first, u.middle, " .
+                    "u.last FROM users u, list l, imembers i " .
+                    "WHERE l.name = 'calendar-acl' " .
+                    "AND l.list_id = i.list_id AND l.list_id = i.list_id " .
+                    "AND i.member_type='USER' AND i.member_id = u.users_id")
+    || exit $MR_DBMS_ERR;
+$sth->execute || exit $MR_DBMS_ERR;
+
+umask 022;
+open(OUT, ">$outfile") || exit $MR_OCONFIG;
+
+while (($clearid, $login, $first, $middle, $last) = $sth->fetchrow_array) {
+    $row = "$clearid^UID=$login/S=$last/G=$first/I=$middle/";
+    $row .= "EMAIL=$login\@mit.edu\n";
+    $row =~ s/\0//g;
+    print OUT $row;
+}
+close(OUT);
+$dbh->disconnect;
+exit 0;
This page took 0.110374 seconds and 5 git commands to generate.