Univention Bugzilla – Bug 33329
If mailHomeServer is empty it is overwritten if an arbitrary attribute is changed
Last modified: 2016-11-28 18:39:26 CET
If the user attribute mailHomeServer is set to empty, it will be changed to the first server entry the next time any user attribute is changed via UMC. mailHomeServer uses the syntax univention.admin.syntax.mailHomeServer, which adds the setting 'appendEmptyValue = True' to the ldapsearch. If the empty value is chosen no univentionMailHomeServer attribute is added to the ldap user object, and the next time the user is edited the default value gets selected. As the mailHomeServer attribute is located on the extended settings tab, the change will most likely go unnoticed. A syntax change to allow an empty value while still maintaining the functionality to automatically choose a default server could fix the problem.
This behaviour is intended to be like that → see Bug 26425. Currently there is no other choice. At that bug, there are also suggestions of how to handle the problem properly.
(In reply to Alexander Kläser from comment #1) > This behaviour is intended to be like that → see Bug 26425. Currently there > is no other choice. At that bug, there are also suggestions of how to handle > the problem properly. No, that is wrong. If the user is modified and the user does not have a mailServer, UMC should use the empty value.
(In reply to Stefan Gohmann from comment #2) > No, that is wrong. If the user is modified and the user does not have a > mailServer, UMC should use the empty value. As discussed, a possible solution would be to define a dynamic default value via a special command that would evaluate all syntax values. For mailHomeServer it could then look like the following: 'mailHomeServer': univention.admin.property( ... 'default': '<:syntax>[1]', # or '<:syntax>[-1]' ), ... Here '<:syntax>' would be evaluated as a syntax call of the corresponding property syntax (here mailHomeServer) accessing the nth element (here 1, i.e., the first non-empty value). The syntax call would be evaluated via the frontend. This would be somewhat in line with the current implementation of default values.
Fixed in univention-management-console-module-udm 4.0.97-15.431.201401101635 univention-directory-manager-modules 9.0.75-11.1164.201401101516 Works by setting "nonempty_is_default=1" in any property of a handler, e.g. mailHomeServer. The syntax of this property should somehow be able to support this (i.e. should be derived from UDM_Objects). In this case the first non-empty value is set in the form if it is a new object. Existing objects are unaffected. This option has no meaning in the udm-cli at the moment.
The following remarks: * Please revert the indentation changes from r47042. * Would it be possible to extract the added lines from DetailPage.js into a separate method? Through the name of the method it would be more understandable what happens there (currently there is no comment). Otherwise, the changes look fine.
(In reply to Alexander Kläser from comment #5) > The following remarks: > * Please revert the indentation changes from r47042. Reintroduced whitespaces in univention-directory-manager-modules 9.0.75-14.1167.201401271216 > * Would it be possible to extract the added lines from DetailPage.js into a > separate method? Through the name of the method it would be more > understandable what happens there (currently there is no comment). Extracted function and added comment in univention-management-console-module-udm 4.0.97-17.433.201401271301
Changes → OK Works like a charm, patch for white spaces has been reverted, extra JS function has been added. Thanks :) . YAML file → OK
http://errata.univention.de/ucs/3.2/38.html
http://errata.univention.de/ucs/3.2/45.html