Univention Bugzilla – Bug 53675
[4.4] Feature: Scheduled activation of user accounts
Last modified: 2021-09-15 18:08:00 CEST
This feature should be available in UCS 4.4 too. +++ This bug was initially created as a clone of Bug #53631 +++ Ticket# 2021071221000421 requests this feature: User story: An administator wants to create a user account but it should only become usable later. At a definable point in time the account gets activated automatically.
9fd9a4fcfb Bug #53631: register UDM property accountActivationDate 010e97fc02 Bug #53631: Define dedicated syntax for UDM property accountActivationDate b164bcfa65 Bug #53631: Adjust layout c510c8a103 Bug #53631: set disabled state if accountActivationDate > now 8f57915ba0 Bug #53631: Add cron based account activation 5609e0fa31 Bug #53631: Use LDAPI to reduce slapd load 5b66377b4d Bug #53631: Testcase for accountActivationDate 49e3354cee Bug #53631: Explain accountActivationDate in manual 53614be86e Bug #53631: Clean up krb5ValidStart in case krb5ValidEnd has also passed 109e9edbae Bug #53631: Extend testcases 3ee218de09 Bug #53631: Reset accountActivationDate to default if disabled state gets changed back to 0 a025909df0 Bug #53631: Convert testcase to Python e4e3895345 Bug #53675: Merge branch 'arequate/bug53675-ucs-issue-651-krb5ValidStart' 51cd65aacd Bug #53675: debian/changelog entries and advisory 584a115b71 Bug #53675: Advisory update
Test cases for ucsschool: a50bc5638 Bug #53675: Add accountActivationDate to user model db6af5809 Bug #53675: Sort existing test cases 23d2e8fc2 Bug #53675: Add tests for accountActivationDate 9646c7091 Bug #53675: debian/changelog entries 3c4b8c707 Bug #53675: Merge branch 'arequate/bug53675-accountActivationDate' Package: ucs-school-lib Version: 12.2.34A~4.4.0.202108291957 Branch: ucs_4.4-0 Scope: ucs-school-4.4 Package: ucs-test-ucsschool Version: 6.0.241A~4.4.0.202108291959 Branch: ucs_4.4-0 Scope: ucs-school-4.4
54a04c5155 Bug #53675: Register ucr template for cron job 54ff7491eb Bug #53675: Advisory update
Some tests from 61_udm-users/40_udm_users_delayed_activation.py currently fail in UCS 4.4-8, see https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-8/job/AutotestJoin/lastCompletedBuild/testReport/
098bf10e43 | fixup! Bug #53631: Register ucr template for cron job 473f6c8246 | Advisory update I've also verified manually that the test case actually fails if the cron job is disabled: ucr set --force directory/manager/user/accountactivation/cron="# " pytest /usr/share/ucs-test/61_udm-users/40_udm_users_delayed_activation.py -k test_disabled_user_creation_activation
IMHO it's common practice to discuss API changes with the team maintaining a library. Proposed changes can be discussed and (p)reviewed in a git branch. Please move the commits to a branch and revert them in main. Then contact the UCS@school team to discuss the intended API change.
Addressed via https://forge.univention.org/bugzilla/show_bug.cgi?id=53718#c8
REOPEN: The test case 86_selenium.153_udm_check_properties_of_copied_users fails: https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-8/job/AutotestJoin/lastCompletedBuild/SambaVersion=no-samba,Systemrolle=master-part-II/testReport/86_selenium/153_udm_check_properties_of_copied_users/master090/ We are seeing a JavaScript exception during copying the object: dojo.js.uncompressed.js:6665 TypeError: Cannot read property 'replace' of null at Object.replace (dojo.js.uncompressed.js:3192) at Object.process (Template.js:190) at Object.<anonymous> (Template.js:175) at Object.forEach (dojo.js.uncompressed.js:4263) at Object.getNewVal (Template.js:174) at Object.<anonymous> (Template.js:211) at Object.forIn (dojo.js.uncompressed.js:18458) at Object._constructor (Template.js:145) at Object.<anonymous> (Template.js:123) at dojo.js.uncompressed.js:2971 When trying to save the object then we get the pop up error message: Die folgenden Eigenschaften konnten nicht validiert werden: Benutzerkonto aktivieren am: Keine gültige Zeitangabe
git:ecbcf27158d5d30ddfc0995a2e465fbba0f54f93 also changes TimeString.size to 'OneThird' for all widgets. This breaks displaying with smaller screens.
The reason is the default value and the templating mechanism, which is used by the copy functionality. Probably setting a user template also fails similar: We are setting the default value: default=[[None, '00:00', tzlocal.get_localzone().zone], []], where None is an invalid value. The default value in this case is valid with the following type definition: # default=(template-str, [list-of-required-properties]) # default type: Tuple[str, List[str]) From python side we don't run into errors, but we run into error on Javascript side then. So None is not allowed, while an empty string would be allowed. But the Date and Time javascript widgets only accept null and not empty strings. And the backend syntax classes also don't accept empty strings and cause python tracebacks then.
What we want to achieve with the default value here is that it does not set any default value: The default should be empty. I will fix that by: * removing the default * allow the (sub) syntax classes to have empty values, so that it adds empty values as first item. * make sure that DateBox can handle empty strings and returns NULL to the backend * make sure that TimeBox can handle empty strings and returns NULL to the backend * to be future proof the JS template mechanism should be able to also handle None instead of only strings and it must be able to handle arrays as complex syntax consists of them
All points addressed in: univention-web.yaml d81ef357567f | Bug #53675: fix copying user object univention-web (3.0.6-11) d81ef357567f | Bug #53675: fix copying user object univention-management-console-module-udm.yaml d81ef357567f | Bug #53675: fix copying user object univention-management-console-module-udm (9.0.15-11) d81ef357567f | Bug #53675: fix copying user object univention-directory-manager-modules (14.0.20-18) d81ef357567f | Bug #53675: fix copying user object
(In reply to Florian Best from comment #2) > > c7c5078800 | Add cron based account activation > REOPEN: cron jobs should test if the scripts to be called exists and > otherwise do nothing. Otherwise a email is send if we remove this script > somewhen but the cron config files is kept. This is not yet implemented.
Created attachment 10818 [details] TwoThirds DateBox ecbcf27158d5d30ddfc0995a2e465fbba0f54f93 adjusts size for all DateBox widgets to TwoThirds This does not look good in e.g. users/user
(In reply to Florian Best from comment #13) > (In reply to Florian Best from comment #2) > > > c7c5078800 | Add cron based account activation > > REOPEN: cron jobs should test if the scripts to be called exists and > > otherwise do nothing. Otherwise a email is send if we remove this script > > somewhen but the cron config files is kept. > > This is not yet implemented. univention-directory-manager-modules (14.0.20-18) 5e6925063fc8 | Bug #53675: add -executable condition to cronjob (In reply to Johannes Keiser from comment #14) > Created attachment 10818 [details] > TwoThirds DateBox > > ecbcf27158d5d30ddfc0995a2e465fbba0f54f93 adjusts size for all DateBox > widgets to TwoThirds > > This does not look good in e.g. users/user univention-directory-manager-modules (14.0.20-18) 38ff65b9cdd1 | Bug #53675: fix sizing of ActivationDateTimeTimezone without influencing all other properties
*** Bug 48904 has been marked as a duplicate of this bug. ***
Fixed also Bug #53631 comment 13 0f4b3405614f | Bug #53675: fix errors due to missing syntax classes during errata upgrades
5ca04f47447b | Bug #53675: [users/user]: apply isort b1d0e5704e38 | Bug #53675: enable crontab every 15 minutes d62d49d81147 | Bug #53675: only set accountActivationDate if all fields are specified 825f9f24ecd7 | Bug #53675: set local timezone as default value of accountActivationDate
The remaining open points were addressed. Automatic and manual tests as described in bug 53631 comment 9 successful Verified
<https://errata.software-univention.de/#/?erratum=4.4x1048> <https://errata.software-univention.de/#/?erratum=4.4x1050> <https://errata.software-univention.de/#/?erratum=4.4x1051> <https://errata.software-univention.de/#/?erratum=4.4x1052>