mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added ldap.get_user_dn() method
This commit is contained in:
parent
446037fd60
commit
149912d0e7
@ -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)
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user