Changeset e8632f2
- Timestamp:
- Mar 9, 2010, 4:41:43 AM (15 years ago)
- Branches:
- master, client
- Children:
- 3bf063c
- Parents:
- f114f8b
- git-author:
- Alex Dehnert <adehnert@…> (03/09/10 04:41:43)
- git-committer:
- Alex Dehnert <adehnert@…> (03/09/10 04:41:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
remit/mit/__init__.py
rc5898ff re8632f2 18 18 else: 19 19 return username 20 def configure_user(self, user, ): 21 username = user.username 22 import ldap 23 con = ldap.open('ldap.mit.edu') 24 con.simple_bind_s("", "") 25 dn = "dc=mit,dc=edu" 26 fields = ['cn', 'sn', 'givenName', 'mail', ] 27 result = con.search_s('dc=mit,dc=edu', ldap.SCOPE_SUBTREE, 'uid=%s'%username, fields) 28 if len(result) == 1: 29 user.first_name = result[0][1]['givenName'][0] 30 user.last_name = result[0][1]['sn'][0] 31 user.email = result[0][1]['mail'][0] 32 user.save() 33 return user
Note: See TracChangeset
for help on using the changeset viewer.