mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-13 09:41:55 -06:00
Allow the API to specify the location in the tree to add users, defaulting
to ou=users,ou=default,$basedn
This commit is contained in:
parent
400ced55eb
commit
a3e786e22e
@ -119,11 +119,11 @@ class IPAServer:
|
||||
|
||||
return self.convert_entry(ent)
|
||||
|
||||
def add_user (self, user, opts=None):
|
||||
def add_user (self, user, user_container="ou=users,ou=default",opts=None):
|
||||
"""Add a user in LDAP"""
|
||||
if (isinstance(user, tuple)):
|
||||
user = user[0]
|
||||
dn="uid=%s,ou=users,ou=default,%s" % (user['uid'], self.basedn)
|
||||
dn="uid=%s,%s,%s" % (user['uid'], user_container,self.basedn)
|
||||
entry = ipaserver.ipaldap.Entry(str(dn))
|
||||
|
||||
# some required objectclasses
|
||||
|
Loading…
Reference in New Issue
Block a user