Univention Bugzilla – Bug 51002
optionsUsersUser syntax should have 'default' as valid choice
Last modified: 2020-04-02 14:47:37 CEST
Problem: initialising a users/user module with an settings/usertemplate has alway 'pki' option set to True as default. When inittializing a users/user module with an settings/usertemplate, if the template has options set, then the default of the options of the module are set to those of the template. If the template has no options set then the default of all options of the module are set to True. management/univention-directory-manager-modules/modules/univention/admin/modules.py def init(lo, position, module, template_object=None, force_reload=False): [...] if key == '_options': if template_object[key] != [''] and template_object[key] != []: for option in module.options.keys(): module.options[option].default = option in template_object[key] else: for option in module.options.keys(): module.options[option].default = True [...] The problem is that the only valid choice for the optionsUsersUser syntax of the settings/usertemplate is 'pki' which means the users/user module will always have the default of 'pki' option set to true since the options of the settings/usertemplate are either [] or ['pki']
Valid point. User templates in python are currently unused (and maybe also more broken than that). Since UCS 3.0 user templates are evaluated in javascript in the UMC frontend. Does the frontend has the same problem? → Otherwise maybe we should not set the default options if the options of the template is empty?!
b34139e52b Bug #51002: yaml d689734d9f Bug #51002: yaml 2c70fea359 Bug #51002: Debian changelog 14bb9d6ee0 Bug #51002: keep defaults of module options if usertemplate has none set Successful build Package: univention-directory-manager-modules Version: 14.0.14-24A~4.4.0.202003301205
What I tested: PKI option is not set for users created with a template (in python) anymore -> OK Tests -> OK yaml -> OK Note: The behaviour is now the same as using a template on the umc -> Verified
<http://errata.software-univention.de/ucs/4.4/504.html>