Next / Previous / Contents / TCC Help System / NM Tech homepage

3. Design notes

Implementation will use the Python programming language.

This project is an example of lightweight literate programming: the script is embedded within the documentation.

This project was developed using the Cleanroom development methodology. In particular, Python comments between [ square brackets ] are Cleanroom intended functions, a form of notation describing what each piece of code is supposed to do.

3.1. Where are the personal homepages?

A user will be considered to have a homepage if they have a world-readable directory named public_html.

We could just ask the HTTP server to serve us the page with the appropriate URL, but this has the undesireable side effect of causing a page fetch that will show up in our Web statistics on user page fetches. Also, why bother the HTTP server when we can just look for the user files directly?

The TCC's LDAP server will be used as the authority for the current set of user account names. The name of the LDAP server, and the DN (distinguished name) of the account root, will be hardcoded into the script. For more information about LDAP, see the document on the proposed TCC Secure LDAP editing facility.

The server address is ldaps://ldap0.nmt.edu:636, and the base DN for accounts is ou=accounts,dc=tcc,dc=nmt,dc=edu. We need only two attributes:

  • The uid attribute, which is the account name.

  • The gecos attribute, which is the person's real name.

The first version of this script caused a problem because it tried to look for user homepages for all the “machine accounts,” special accounts created for each user area workstation. Because such accounts have their home directories specified as /dev/null, the script caused many failures of the automounter to bind to /dev/null. We get around that by ignoring accounts whose uid attributes end with “$”.