mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
change strings to be encoded using value.encode("utf-8").
fix update to set 'cn' instead of 'sn'. remove str() in funcs.add_user().
This commit is contained in:
@@ -49,7 +49,7 @@ def set_ldap_value(hash, key, value):
|
||||
"""Converts unicode strings to normal strings
|
||||
(because LDAP is choking on unicode strings"""
|
||||
if value != None:
|
||||
value = str(value)
|
||||
value = value.encode('utf-8')
|
||||
hash[key] = value
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class Root(controllers.RootController):
|
||||
#
|
||||
# this is a hack until we decide on the policy for names/cn/sn/givenName
|
||||
#
|
||||
set_ldap_value(new_user, 'sn',
|
||||
set_ldap_value(new_user, 'cn',
|
||||
"%s %s" % (kw.get('givenname'), kw.get('sn')))
|
||||
|
||||
orig_user = to_ldap_hash(orig_user)
|
||||
|
||||
@@ -197,7 +197,7 @@ class IPAServer:
|
||||
user = user[0]
|
||||
|
||||
dn="uid=%s,%s,%s" % (user['uid'], user_container,self.basedn)
|
||||
entry = ipaserver.ipaldap.Entry(str(dn))
|
||||
entry = ipaserver.ipaldap.Entry(dn)
|
||||
|
||||
# some required objectclasses
|
||||
entry.setValues('objectClass', 'top', 'posixAccount', 'shadowAccount', 'account', 'person', 'inetOrgPerson', 'organizationalPerson', 'krbPrincipalAux', 'krbTicketPolicyAux')
|
||||
@@ -214,7 +214,7 @@ class IPAServer:
|
||||
|
||||
# fill in our new entry with everything sent by the user
|
||||
for u in user:
|
||||
entry.setValues(str(u), str(user[u]))
|
||||
entry.setValues(u, user[u])
|
||||
|
||||
if opts:
|
||||
self.set_principal(opts['remoteuser'])
|
||||
|
||||
Reference in New Issue
Block a user