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:
pcoder116 2019-05-02 00:34:10 +02:00
commit de44229ac2

View file

@ -91,14 +91,16 @@ class LdapManager:
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
self._set_max_uid(uidNumber)
try:
conn.add(
("uid={uid}," + settings.LDAP_CUSTOMER_DN).format(uid=user),
uid = user.encode("utf-8")
conn.add("uid={uid},{customer_dn}".format(
uid=uid, customer_dn=settings.LDAP_CUSTOMER_DN
),
["inetOrgPerson", "posixAccount", "ldapPublickey"],
{
"uid": [user.encode("utf-8")],
"uid": [uid],
"sn": [lastname.encode("utf-8")],
"givenName": [firstname.encode("utf-8")],
"cn": ["{} {}".format(firstname, lastname).encode("utf-8")],
"cn": [uid],
"displayName": ["{} {}".format(firstname, lastname).encode("utf-8")],
"uidNumber": [str(uidNumber)],
"gidNumber": [str(settings.LDAP_CUSTOMER_GROUP_ID)],