[1955] in Moira
Re: calendar.gen
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed May 15 17:24:32 2002
Message-Id: <200205152124.RAA02013@brad-majors.mit.edu>
To: Mark Silis <mark@MIT.EDU>
cc: moiradev@MIT.EDU
In-Reply-To: Your message of "Wed, 15 May 2002 16:21:24 EDT."
<20020515202124.GC2971@localhost.MIT.EDU>
Date: Wed, 15 May 2002 17:24:30 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
>> +$sth = $dbh->prepare("SELECT u.clearid, u.login, u.first, u.middle, u.last, " .
>> + "u.office_phone, u.department 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")
I'm not sure I'm thrilled about hardcoding the listname like this;
pulling it out of value3 in the serverhosts table would allow us to
change what list is looked at without editing code, but would make the
generation script more complicated, since you'd need to create one file
per machine receiving the calendar service.
>> + if (length($office_phone) == 5) {
>> + $office_phone = "617-25" . substr($office_phone, 0, 1) . "-" .
>> + substr($office_phone, 1, 4);
You need to be more careful here; some people have office phones
listed as being in the 225 exchange, and this will do the wrong thing
for them. You might consider explicity checking for a leading 2, 3, or
8 in addition to checking that office_phone is length 5.
Garry