Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117757091
D2900.1775206938.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D2900.1775206938.diff
View Options
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -647,13 +647,7 @@
if len(_filter) <= 6:
return None
- config_base_dn = self.config_get('resource_base_dn')
- ldap_base_dn = self._kolab_domain_root_dn(self.domain)
-
- if ldap_base_dn is not None and not ldap_base_dn == config_base_dn:
- resource_base_dn = ldap_base_dn
- else:
- resource_base_dn = config_base_dn
+ resource_base_dn = self._object_base_dn('resource')
_results = self.ldap.search_s(
resource_base_dn,
@@ -801,13 +795,7 @@
if len(_filter) <= 6:
return None
- config_base_dn = self.config_get('resource_base_dn')
- ldap_base_dn = self._kolab_domain_root_dn(self.domain)
-
- if ldap_base_dn is not None and not ldap_base_dn == config_base_dn:
- resource_base_dn = ldap_base_dn
- else:
- resource_base_dn = config_base_dn
+ resource_base_dn = self._object_base_dn('resource')
_results = self.ldap.search_s(
resource_base_dn,
@@ -2470,9 +2458,7 @@
conf_prefix = 'kolab_' if kolabuser else ''
- user_base_dn = self.config_get(conf_prefix + 'user_base_dn')
- if user_base_dn is None:
- user_base_dn = self.config_get('base_dn')
+ user_base_dn = self._object_base_dn('user', conf_prefix)
auth_attrs = self.config_get_list('auth_attributes')
@@ -2684,6 +2670,26 @@
return domains
+ def _object_base_dn(self, objectType, prefix=''):
+ """
+ Get configured base DN for specified Kolab object type
+ """
+ object_base_dn = self.config_get(prefix + objectType + '_base_dn')
+ config_base_dn = self.config_get('base_dn')
+ ldap_base_dn = self._kolab_domain_root_dn(self.domain)
+
+ if ldap_base_dn is not None and not ldap_base_dn == config_base_dn:
+ base_dn = ldap_base_dn
+ else:
+ base_dn = config_base_dn
+
+ if object_base_dn is None:
+ object_base_dn = base_dn
+ else:
+ object_base_dn = object_base_dn % ({'base_dn': base_dn})
+
+ return object_base_dn
+
def _synchronize_callback(self, *args, **kw):
"""
Determine the characteristics of the callback being placed, and
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 9:02 AM (20 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18820445
Default Alt Text
D2900.1775206938.diff (2 KB)
Attached To
Mode
D2900: Resolve %base_dn in kolab_user_base_dn, user_base_dn and resource_base_dn
Attached
Detach File
Event Timeline