From ab12fa3d776e4ebf87d76d3a987fbede033c8bc5 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 2 Feb 2012 15:09:00 -0500 Subject: [PATCH] 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 --- tools/patron-load/ldap_osrf_sync | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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() -- 2.11.0