summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-26 14:39:24 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-26 14:39:24 +0100
commitf184ecd427b7ae97acf510d7a6876f9afa28b906 (patch)
treeff4a9ff47f2efa30f29c8b59fb14a028f3b93490 /pykolab
parentaa3c5b4a9c00050390a5ba37a76ff769956179db (diff)
downloadpykolab-f184ecd427b7ae97acf510d7a6876f9afa28b906.tar.gz
Apply the recipient policy to entries with existing attributes as well (so mailboxes get renamed and such).
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py35
1 files changed, 16 insertions, 19 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 61ae4a8..c538083 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -522,12 +522,14 @@ class LDAP(pykolab.base.Base):
log.debug(_("sec. mail pol. is not empty"), level=8)
want_attrs.append(_mail_attr)
- log.debug(_("Attributes %r are not yet available for entry %r") % (
- want_attrs,
- entry_dn
- ),
- level=8
- )
+ if len(want_attrs) > 0:
+ log.debug(_("Attributes %r are not yet available for entry %r") % (
+ want_attrs,
+ entry_dn
+ ),
+ level=8
+ )
+
# Also append the preferredlanguage or 'native tongue' configured
# for the entry.
if not entry.has_key('preferredlanguage'):
@@ -551,19 +553,14 @@ class LDAP(pykolab.base.Base):
# Primary mail address
if not primary_mail == None:
- if not entry.has_key(primary_mail_attribute) or \
- entry[primary_mail_attribute] == None:
-
- primary_mail_address = conf.plugins.exec_hook(
- "set_primary_mail",
- kw={
- 'primary_mail': primary_mail,
- 'entry': entry,
- 'primary_domain': self.domain
- }
- )
- else:
- primary_mail_address = entry[primary_mail_attribute]
+ primary_mail_address = conf.plugins.exec_hook(
+ "set_primary_mail",
+ kw={
+ 'primary_mail': primary_mail,
+ 'entry': entry,
+ 'primary_domain': self.domain
+ }
+ )
i = 1
_primary_mail = primary_mail_address