Univention Bugzilla – Bug 52786
Ignore disabled users when creating an exam
Last modified: 2023-05-26 15:39:16 CEST
This bug is related to bug #52372 Enabling the UCRV "ucsschool/exam/user/disable" leads to deactivating the original users during an exam to prevent them from using other services (eg. Mail, Cloud...). When the exam is finished, the disabled attribute is set False again which enables the user object. Since it is not trivial to store the previous state of that attribute, an already disabled user which participates an exam gets activated as well when the exam is finished. Usually it is not desired that disabled user can even participate an exam in the first place. A fix should therefore implement the following features: 1. Users with the "disable" attribute set True, are ignored when an exam is created. They are not added to the exam. 2. Those ignored users should be logged correspondingly
I added a patch on branch troehmey/bug52786 with 7ff06cc9d Bug #52786: ignore disabled users when creating exam Disabled users now get ignored when an exam is created i.e. no exam-user account will be created and they won't be added to the exam group. Cases of ignored user will be logged under /var/log/univention/management-console-module-schoolexam-master.log
Please add a paragraph about disabled users being excluded from exams to ucsschool-handbuch → school:exam:concept.
Added doc paragraph with c4694fba6 Bug #52786: added paragraph to exam doc Spellcheck: https://jenkins.knut.univention.de:8181/view/Doku/job/BuildDocBookBranchUCSSchool/50/ I also added a short note on the user disable functionality from bug #52372 to school:exam:concept.
QA → A couple of remarks, but already working → REOPEN `tempfile.NamedTemporaryFile(dir="/tmp")` → Was this causing a problem? User ignored because disabled: → Ignore disabled user {} `self.finished(request.id, dict(success=True, userdn=userdn, examuserdn=""))` Why not `self.finished(request.id, None)`? As far as I can see `userdn` is not used since the user is ignored. This way you could simply write `if not ires: continue` Doc z.B. Mail, Cloud... → z.B. Mail oder Cloud Wie Benutzer aktiviert/deaktiviert werden können, wird im UCS-Handbuch<biblioref linkend="ucs-handbuch"/> beschrieben. → Where exactly? Add a ref to link to the section and move this to the end of the sentence before, like "(siehe ...)" Functionalities before fix: exam-a.zombie is created during exam start → OK after fix: exam-a.zombie is not created during exam start → OK
(In reply to Tobias Wenzel from comment #4) > `tempfile.NamedTemporaryFile(dir="/tmp")` > → Was this causing a problem? This is because bandit is unhappy with hard coded temporary directories (https://bandit.readthedocs.io/en/latest/plugins/b108_hardcoded_tmp_directory.html).
I applied the suggested improvement from comment #4 with e8e1dbafa Bug #52786: minor code improvements However, I did not change the doc because: - A UCS-manual section is nowhere else referenced in the ucs@school manual. - I think the separate sentence for the reference improves the understanding of WHY it is worth to take a look into the UCS manual. Otherwise, the reader may not know what to search for.
QA → All OK → REOPEN for Merge, changelog & yaml, build and yaml version update [troehmey/bug52786] e8e1dbafa Bug #52786: minor code improvements → please squash this commit to 7ff06cc9d [troehmey/bug52786] c4694fba6 Bug #52786: added paragraph to exam doc [troehmey/bug52786] 7ff06cc9d Bug #52786: ignore disabled users when creating exam Doc (non-)changes → OK Code Changes → OK Functionality → OK
Merged to 4.4 with 7e5114872 Bug #52786: added yaml 28c0ec8ac Bug #52786: added changelog entry 084e04aea Bug #52786: Merge branch 'troehmey/bug52786' into 4.4 28c96ed13 Bug #52786: ignore disabled users when creating exam successful build: Package: ucs-school-umc-exam Version: 9.0.1-49A~4.4.0.202103061221 Branch: ucs_4.4-0 Scope: ucs-school-4.4
QA → All OK → Verfiy Changelog → OK YAML → OK Merge → OK Jenkins → Green
UCS@school 4.4 v9 has been released. https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html If this error occurs again, please clone this bug.