You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

import ldap, time, operator
# globals
cscUri = ""
cscTerms = ["Winter", "Spring", "Fall"]
cscShortTerms = ['w', 's', 'f']
cscLdapUri = "ldap:// ldap://"
cscLdap = None
cscPeopleBase = 'ou=People,dc=csclub,dc=uwaterloo,dc=ca'
def cscLdapConnect():
global cscLdap
cscLdap = ldap.initialize(cscLdapUri)
cscLdap.simple_bind_s("", "")
def showExec(pretty, short):
print "<p><b>" + pretty + "</b><br>"
members = cscLdap.search_s(cscPeopleBase, ldap.SCOPE_SUBTREE,
'(&(objectClass=member)(position=%s))' % short)
if len(members) > 0:
(_, user) = members[0]
print user['cn'][0]
print 'Seat Empty'
print "</p>"
print "<h1>The Executive</h1>"
showExec("President", "president")
showExec("Vice-President", "vice-president")
showExec("Treasurer", "treasurer")
showExec("Secretary", "secretary")
showExec("Systems Administrator", "sysadmin")
print "<h1>Other Positions</h1>"
showExec("Chief Returning Officer", "cro")
showExec("Office Manager", "offsck")
showExec("Librarian", "librarian")
print "<h1>Past Executive</h1>"
print "<p>For a partial list of past executives, see <a href=\"\">the relevent wiki page</a></p>"
print "<h1>Elections</h1>"
print "<p>Each term the CSC holds elections to determine the executive council. To find out when and where the next elections will be held, check the homepage and the <a href=\"\"></a> newsgroup.<br>"
print "</p><p>For details on the election rules, see the <a href=\"../Constitution\">constitution</a>."
print "</p>"