Univention Bugzilla – Bug 48621
Add Tab to enable apps
Last modified: 2019-03-12 13:40:49 CET
Created attachment 9829 [details] Mock Up The users/user view should have a tab which shows a checkbox for every available app and to activate users for this app. See attachment for a mock up.
Created attachment 9830 [details] Screenshot (current state)
Implemented in the branch fbest/udm-app-tabs. Not yet merged into 4.4-0, will do that as soon as the apps are adjusted (Bug #48623).
I made some pseudo-API-changes for the .attributes file: Type=ExtendedAttribute must be set now, so it's future proof for things which are added later. If type is not set, only a log message is produced. The old code does not consider if attributes are removed! Therefore if one attribute gets removed and another gets added it would get the OID of the old attribute. I won't adjust/fix this. It could be done e.g. with "Type=DeprecatedOID; ID=2". Another change is, that it's not necessary to create a "appidActivated" boolean attribute anymore. The object-class can e.g. be used as indicator. But as there are apps out which use this feature already, the attribute is still written if GenericUserActivation=Version1.
Failing test: http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/view/Branch%20Tests/job/branch%20test%20appcenter%20singlemaster/lastCompletedBuild/testReport/80_docker/68_extended_attributes/test/
The appcenter does a udm settings/extended_attribute create $all_args; udm setttings/extended_attribute modify $all_args. This causes the following traceback: Type or value exists: modify/add: univentionUDMPropertyLayoutOverwritePosition: value #0 already exists Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/__init__.py", line 226, in call_with_namespace result = self.main(namespace) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/register.py", line 87, in main self._register_attributes_for_apps(apps, args) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/register.py", line 196, in _register_attributes_for_apps self._register_attributes(app, args) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/register.py", line 241, in _register_attributes create_extended_attribute(attribute, app, i + 1, lo, pos) File "/usr/lib/pymodules/python2.7/univention/appcenter/extended_attributes.py", line 405, in create_extended_attribute modify_object('settings/extended_attribute', lo, pos, attribute.dn, **attrs) File "/usr/lib/pymodules/python2.7/univention/appcenter/udm.py", line 114, in modify_object obj.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 583, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1222, in _modify self.lo.modify(self.dn, ml, ignore_license=ignore_license, serverctrls=serverctrls, response=response) File "/usr/lib/pymodules/python2.7/univention/admin/uldap.py", line 828, in modify raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg) ldapError: Type or value exists: modify/add: univentionUDMPropertyLayoutOverwritePosition: value #0 already exists → Needs to be fixed in UDM.
It was added here: commit d56dd9692197b6acb4d7961627a7017c41a04b2a Author: Andreas Büsching <buesching@univention.de> Date: Mon Oct 17 15:22:54 2011 +0000 fix typo in script univention-remove-old-umc-objects; Bug #24045 ; fix handling of extended attributes; Bug #23988 git-svn-id: svn+ssh://….univention.de/var/univention/svn/dev/branches/ucs-3.0/ucs@27891 1b283449-9f2f-0410-b571-8eb228e1a901 +» » if self.dn and self.info.has_key( 'overwritePosition' ) and self.info[ 'overwritePosition' ] == '0': +» » » self.info[ 'overwritePosition' ] = '' Hm, i will just remove this from the OX extended attributes. I think overwritePosition isn't even evaluated anymore.
There was a interim regression when creating user templates: LDAP Error: Object class violation: object class 'univentionMail' requires attribute 'uid' http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/AutotestJoin/lastCompletedBuild/SambaVersion=s4,Systemrolle=master/testReport/71_udm-settings/10_create_usertemplate/test/ This was caused by the extended attribute "cn=UniventionDovecotUserQuota" which always added a default value of "0" to the ldap while univentionTemplateObjects don't have a "uid" attribute. Fixed by ommiting univentionMail extended attributes.
Fixed so far :-) I'll might make some small adjustments to the layout but the basis functionality should be reviewed and QAed now.
The test case for user templates fails: http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-0/job/ADMemberMultiEnv/lastCompletedBuild/Mode=installation,Version=w2k12r2-france/testReport/71_udm-settings/11_use_usertemplate/test/ (2019-02-19 23:21:40.118031) Traceback (most recent call last): (2019-02-19 23:21:40.118089) File "11_use_usertemplate", line 77, in <module> (2019-02-19 23:21:40.118190) dn_template = udm.create_object(MOD_TMPL, wait_for_replication=False, **properties) (2019-02-19 23:21:40.118250) File "/usr/lib/pymodules/python2.7/univention/testing/udm.py", line 270, in create_object (2019-02-19 23:21:40.118376) raise UCSTestUDM_CreateUDMObjectFailed({'module': modulename, 'kwargs': kwargs, 'returncode': child.returncode, 'stdout': stdout, 'stderr': stderr}) (2019-02-19 23:21:40.118610) univention.testing.udm.UCSTestUDM_CreateUDMObjectFailed: returncode=3 (2019-02-19 23:21:40.118630) stdout=Invalid syntax: _options:
Sumarizing the changes: Every app can now define a settings/extended_options object which maps option-name to ldap object class (e.g. appUser → appObjectClass). All extended attributes of the app are adjusted to use the option (settings/extended_attribute modify --set option="appUser"). The schema for settings/extended_options has been adapted: The attribute univentionUDMOptionIsApp 1.3.6.1.4.1.10176.200.209 has been added to the objectclass univentionUDMOption. udm settings/extended_options create … --set isApp=1 Every app which currently specifies its enabled-state via an attribute *should* now change the visibility of that attribute to be hidden in UMC and the default to true (--set disableUDMWeb=1 --set default=1). Therefore the UMC isn't displaying 2 checkboxes per app but only one, to activate a user. And via the default value it's ensured that the appEnabled=1 is set. If the checkbox gets unmarked the object class and every attribute is removed from the object. REOPEN: the current implementation doesn't consider objects which currently have appEnabled=FALSE set, which are then shown as activated while they are disabled. Therefore *new* apps would be able to adjust their filter to "(objectClass=appUser)" instead of "(appEnabled=1)". The UDM-CLI has been adjusted: * create/modify now have the --remove-option --append-option * create/modify now set the option automatically if --set appEnabled=1 was given without "--append-option appUser" (if the option only depends on one option, otherwise not, because e.g. in UCS@school attribute may have multiple options (teacher, admin, student, staff). The usertemplates have been adjusted: You can use --set _options and --append-options both now. This makes the design in UMC much more better, as it behaves like a regular user now (with the options page instead of a drop down of options, so that some fields appear when you enable an option). MulitEdit mode has been adjusted, so that you can modify options there. This does currently only work for all options, not for single options. I think we have to improove this further in the future. The AppListener now writes the options also into the json file. "Group"s of the UDM-layout may have a description. This description is shown again (and used for the "Activated Apps"-Group). App ini files now may declare: GenericUserActivationOption = name of the option GenericUserActivationAttribute = name of the attribute If GenericUserActivationAttribute is not set, no attribute will be created (imho suggested for new apps).
When installing OpenProject in 4.4, the App is missing the attribute openproject-isadmin. From the logs: Unknown attribute type for section openprojectActivated: None Unknown attribute type for section openproject-isadmin: None
(In reply to Dirk Wiesenthal from comment #11) > When installing OpenProject in 4.4, the App is missing the attribute > openproject-isadmin. From the logs: > > Unknown attribute type for section openprojectActivated: None > Unknown attribute type for section openproject-isadmin: None That's because in the test-appcenter is not anymore the latest version! Use the version from: https://github.com/finnlabs/ucs-openproject/blob/master/dist/openproject.attributes
The icons are not distributed: If I install an App on a memberserver, the UDM UMC module does not show the App icon on the Apps tab.
Okay, Dirk and I discussed the following solution: We introduce two syntax classes (appActivatedTrue, appActivatedBoolean) which are distributed to all systems in the domain. The checkbox-extended-attributes of the apps are set to this syntax. These syntaxes do the correct handling in the underlying UDM. We backport the appcenter for UCS 4.3-erratum and make the app versions depend on that erratum. The erratum ignores all extended attributes, so everything behaves in UCS 4.3 exactly as prior. We migrate the joinscripts of the apps to .attributes files, which is possible with the erratum then.
Implemented the above variant. To test this, I updated the pull request for ownCloud/nextCloud. You can test it with these attribute files. The icons have also been fixed.
*** Bug 48788 has been marked as a duplicate of this bug. ***
*** Bug 48796 has been marked as a duplicate of this bug. ***
Seems like the extended options do not get removed after uninstallation? Minor: Apps with .attributes installed in 4.3 add a Tab "Apps", too. So we have two tabs afterwards. I guess we can overlook this?
(In reply to Dirk Wiesenthal from comment #18) > Seems like the extended options do not get removed after uninstallation? Cannot reproduce it. Are you sure? > Minor: Apps with .attributes installed in 4.3 add a Tab "Apps", too. So we > have two tabs afterwards. I guess we can overlook this? I fixed this, so that they are all shown on one tab.
After update from 4.3 to 4.4, openprojectActivated and relutionActivated (and probably all the others) are still visible
(even after univention-app register on the newly updated system)
(In reply to Dirk Wiesenthal from comment #20) > After update from 4.3 to 4.4, openprojectActivated and relutionActivated > (and probably all the others) are still visible Fixed.
The extended option is not created by default anymore and must be explicit set by GenericUserActivationOption = True / appidUser. git commit f2114b0a2298c28321ad5666ceadf23e39eaea33. It is not possible to prevent the automatic schema creation via the ini variable AutomaticSchemaCreation = False. git commit 7925a0c4ac308d137e28679ecdc202e0e2083a2b
Looks great
*** Bug 48854 has been marked as a duplicate of this bug. ***
this class optionsUsersUser(select): - choices = [ - ('pki', _('Public key infrastructure account')), - ] + choices = [('pki', _('Public key infrastructure account'))] + + @classmethod + def update_choices(cls): + users = univention.admin.modules.get('users/user') + if users: + cls.choices = [(key, x.short_description) for key, x in users.options.items() if key != 'default'] + + +__register_choice_update_function(optionsUsersUser.update_choices) breaks the 71_udm-settings.11_use_usertemplate.test Traceback (most recent call last): (2019-03-06 07:32:11.221203) File "11_use_usertemplate", line 77, in <module> (2019-03-06 07:32:11.221229) dn_template = udm.create_object(MOD_TMPL, wait_for_replication=False, **properties) (2019-03-06 07:32:11.221258) File "/usr/lib/pymodules/python2.7/univention/testing/udm.py", line 270, in create_object (2019-03-06 07:32:11.221317) raise UCSTestUDM_CreateUDMObjectFailed({'module': modulename, 'kwargs': kwargs, 'returncode': child.returncode, 'stdout': stdout, 'stderr': stderr}) (2019-03-06 07:32:11.221351) univention.testing.udm.UCSTestUDM_CreateUDMObjectFailed: returncode=3 (2019-03-06 07:32:11.221373) stdout=Invalid syntax: _options: (2019-03-06 07:32:11.221392) stderr= (2019-03-06 07:32:11.221412) module=settings/usertemplate (2019-03-06 07:32:11.221514) kwargs={'homedrive': 'H:', 'disabled': '1', 'homeShare': 'cn=c3oh4yr6kb,dc=AutoTest091,dc=local', 'postcode': '1', 'scriptpath': '//bdf64sof0i/scripts/<username>', 'city': 'iep6towqcn', 'employeeType': 'ggdcug460j', 'sambahome': '//bdf64sof0i/<username>', 'title': 'uxaw6nrztd', 'mailAlternativeAddress': ['<username>@v6nmhk4mds.ai1v300yrj', '<lastname>@v6nmhk4mds.ai1v300yrj'], 'homeSharePath': '<username>[0]/<username>', 'e-mail': 'i7ithp3usf.v6nmhk4mds.ai1v300yrj', 'pwdChangeNextLogin': '1', 'unixhome': '/home/<username>[0]/<username>', 'departmentNumber': '0', 'shell': '/bin/false', 'description': 'kigj6214vq', 'phone': '+49-421-22232-0', 'employeeNumber': '8', 'groups': ['cn=s9osdvj11k,cn=groups,dc=AutoTest091,dc=local', 'cn=dfvryr0w6a,cn=groups,dc=AutoTest091,dc=local'], 'primaryGroup': 'cn=ozew6x0obl,cn=groups,dc=AutoTest091,dc=local', 'mailPrimaryAddress': '<firstname>.<lastname>@v6nmhk4mds.ai1v300yrj', 'displayName': '<lastname>, <firstname>', 'name': 'snj7ijlazg', '_options': ['pki'], 'country': 'DE', 'roomNumber': '3', 'street': 'ofogh86f6w', 'profilepath': '//bdf64sof0i/profile/<username>', 'organisation': 'bpg1udx2nt', 'secretary': 'uid=daeru7yu7y,cn=users,dc=AutoTest091,dc=local'}
(In reply to Felix Botner from comment #26) Thanks, fixed in 89ce1861.
Ok, works. Fixed 80_docker/68_extended_attributes.
UCS 4.4 has been released: https://docs.software-univention.de/release-notes-4.4-0-en.html https://docs.software-univention.de/release-notes-4.4-0-de.html If this error occurs again, please use "Clone This Bug".