Univention Bugzilla – Bug 48696
Using "normalize" in import config produces usernames that don't match "scheme"
Last modified: 2019-07-04 11:02:53 CEST
Using this: "normalize": { "firstname": false, "lastname": false }, will keep umlauts etc. in firstname, lastname and displayname. However it contradicts the scheme for username and mail, e.g.: "scheme": { "username": { "allow_rename": false, "default": "<firstname>[0:5].<lastname>[0:5]<:umlauts,lower>[COUNTER2]" } This should generate something like this: Elisabeth Schäfer -> elisa.schae (5 characters) But in fact it generates this: Elisabeth Schäfer -> elisa.schaef (6 characters) I assume that internally we do have a "elisa.schäf" that is compliant to the scheme at some point and then the normalization happens afterwards, expanding "schäf" to "schaef".
That's an encoding problem: from univention.admin import property as uadmin_property prop = uadmin_property("_replace") prop._replace('<firstname>[0:5].<lastname>[0:5]<:umlauts,lower>', {'firstname': 'Elisabeth', 'lastname': 'Schäfer'}) → 'elisa.schae' prop._replace(u'<firstname>[0:5].<lastname>[0:5]<:umlauts,lower>', {u'firstname': u'Elisabeth', u'lastname': u'Schäfer'}) → 'elisa.schaef' len(u'Schäfer') → 7 len('Schäfer') → 8
You can fix your configuration by 1st normalizing the names and then truncating them: prop._replace(u'<firstname:umlauts,lower>[0:5].<lastname:umlauts,lower>[0:5]', {u'firstname': u'Elisabeth', u'lastname': u'Schäfer'}) → u'elisa.schae' "default": "<firstname:umlauts>[0:5].<lastname:umlauts>[0:5]<:lower>[COUNTER2]"
yes, works like a charm :) Thanks!
UCS@school 4.3 v7 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v7-de.html If this error occurs again, please clone this bug.
*** Bug 49784 has been marked as a duplicate of this bug. ***