diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-14 00:38:17 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-14 00:38:17 -0600 |
commit | 149912d0e7bb75459c52c9404a1af537023729dc (patch) | |
tree | c9c6d5c72be8f833782e28da3e1cadc897240ddd | |
parent | 446037fd60d59f671b9a402b9111ab041c1c1439 (diff) | |
download | freeipa-149912d0e7bb75459c52c9404a1af537023729dc.tar.gz freeipa-149912d0e7bb75459c52c9404a1af537023729dc.tar.xz freeipa-149912d0e7bb75459c52c9404a1af537023729dc.zip |
Added ldap.get_user_dn() method
-rw-r--r-- | ipa_server/plugins/b_ldap.py | 10 | ||||
-rw-r--r-- | ipalib/config.py | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ipa_server/plugins/b_ldap.py b/ipa_server/plugins/b_ldap.py index 827e25120..6383bb0b5 100644 --- a/ipa_server/plugins/b_ldap.py +++ b/ipa_server/plugins/b_ldap.py @@ -35,4 +35,14 @@ class ldap(Backend): dn = _ldap.dn + def get_user_dn(self, uid): + """ + Construct user dn from uid. + """ + return 'uid=%s,%s,%s' % ( + self.dn.escape_dn_chars(uid), + self.api.env.container_user, + self.api.env.basedn, + ) + api.register(ldap) diff --git a/ipalib/config.py b/ipalib/config.py index a0a33b401..c55c47c8a 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -25,13 +25,15 @@ DEFAULT_CONF='/etc/ipa/ipa.conf' def generate_env(d={}): default = dict( - server_context = False, + server_context = True, query_dns = True, verbose = False, interactive = True, server = LazyIter(get_servers), realm = LazyProp(get_realm), domain = LazyProp(get_domain), + container_user='cn=users,cn=accounts', + basedn='dc=example,dc=com', ) for key, value in d.iteritems(): if key in default and type(default[key]) in (LazyIter, LazyProp): |