Bug 33329 - If mailHomeServer is empty it is overwritten if an arbitrary attribute is changed
If mailHomeServer is empty it is overwritten if an arbitrary attribute is cha...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.2-0-errata
Assigned To: Dirk Wiesenthal
Alexander Kläser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 14:28 CET by Erik Damrose
Modified: 2016-11-28 18:39 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2013-11-12 14:28:49 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.
Comment 1 Alexander Kläser univentionstaff 2013-11-14 09:40:58 CET
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.
Comment 2 Stefan Gohmann univentionstaff 2013-11-21 14:05:23 CET
(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.
Comment 3 Alexander Kläser univentionstaff 2013-11-21 14:39:54 CET
(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.
Comment 4 Dirk Wiesenthal univentionstaff 2014-01-10 16:41:18 CET
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.
Comment 5 Alexander Kläser univentionstaff 2014-01-24 15:24:48 CET
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.
Comment 6 Dirk Wiesenthal univentionstaff 2014-01-27 13:20:52 CET
(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
Comment 7 Alexander Kläser univentionstaff 2014-01-27 17:15:03 CET
Changes → OK
Works like a charm, patch for white spaces has been reverted, extra JS function has been added. Thanks :) .

YAML file → OK
Comment 8 Moritz Muehlenhoff univentionstaff 2014-01-29 11:19:43 CET
http://errata.univention.de/ucs/3.2/38.html
Comment 9 Moritz Muehlenhoff univentionstaff 2014-01-29 11:22:09 CET
http://errata.univention.de/ucs/3.2/45.html