From: Dan Scott Date: Thu, 2 Feb 2012 20:09:00 +0000 (-0500) Subject: Fully-qualified CN is not a good basis for email addresses X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1676e8e99f6a292f7c5184ad1ef79eb239eaf964;p=contrib%2FConifer.git Fully-qualified CN is not a good basis for email addresses Not unless you really like cn=Foo,ou=Bar@foobar.ca as an email address, anyway. Signed-off-by: Dan Scott --- diff --git a/tools/patron-load/ldap_osrf_sync b/tools/patron-load/ldap_osrf_sync index 5f0795caa5..c6c081e582 100755 --- a/tools/patron-load/ldap_osrf_sync +++ b/tools/patron-load/ldap_osrf_sync @@ -80,14 +80,15 @@ class User: self.cname = raw_ldap[0] self.ldap_atts = raw_ldap[1] + self.cn = self._simple_map('cn') self.lang_pref = self._simple_map('preferredLanguage') if 'mail' not in self.ldap_atts: if self.lang_pref and self.lang_pref == 'f': - self.email = self.cname + '@laurentienne.ca' + self.email = self.cn + '@laurentienne.ca' else: - self.email = self.cname + '@laurentian.ca' - print >> sys.stderr, '"mail" not found for %s, using %s' % (self.cname, self.email) + self.email = self.cn + '@laurentian.ca' + print >> sys.stderr, '"mail" not found for %s, using %s' % (self.cn, self.email) # return None else: self.email = (self._simple_map('mail') or '').lower()