Merge branch 'make-cn-uid-uname-same' into 'master'
Make cn, uid, uname the same See merge request ungleich-public/ungleich-user!5
This commit is contained in:
commit
de44229ac2
1 changed files with 6 additions and 4 deletions
|
@ -91,14 +91,16 @@ class LdapManager:
|
||||||
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
|
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
|
||||||
self._set_max_uid(uidNumber)
|
self._set_max_uid(uidNumber)
|
||||||
try:
|
try:
|
||||||
conn.add(
|
uid = user.encode("utf-8")
|
||||||
("uid={uid}," + settings.LDAP_CUSTOMER_DN).format(uid=user),
|
conn.add("uid={uid},{customer_dn}".format(
|
||||||
|
uid=uid, customer_dn=settings.LDAP_CUSTOMER_DN
|
||||||
|
),
|
||||||
["inetOrgPerson", "posixAccount", "ldapPublickey"],
|
["inetOrgPerson", "posixAccount", "ldapPublickey"],
|
||||||
{
|
{
|
||||||
"uid": [user.encode("utf-8")],
|
"uid": [uid],
|
||||||
"sn": [lastname.encode("utf-8")],
|
"sn": [lastname.encode("utf-8")],
|
||||||
"givenName": [firstname.encode("utf-8")],
|
"givenName": [firstname.encode("utf-8")],
|
||||||
"cn": ["{} {}".format(firstname, lastname).encode("utf-8")],
|
"cn": [uid],
|
||||||
"displayName": ["{} {}".format(firstname, lastname).encode("utf-8")],
|
"displayName": ["{} {}".format(firstname, lastname).encode("utf-8")],
|
||||||
"uidNumber": [str(uidNumber)],
|
"uidNumber": [str(uidNumber)],
|
||||||
"gidNumber": [str(settings.LDAP_CUSTOMER_GROUP_ID)],
|
"gidNumber": [str(settings.LDAP_CUSTOMER_GROUP_ID)],
|
||||||
|
|
Loading…
Reference in a new issue