Bug 52372 - Exam mode: Deactivate original users during exam
Exam mode: Deactivate original users during exam
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other other
: P5 normal (vote)
: UCS@school 4.4 v8-errata
Assigned To: Toni Röhmeyer
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-17 16:11 CET by Michael Grandjean
Modified: 2021-02-03 11:10 CET (History)
9 users (show)

See Also:
What kind of report is it?: Feature Request
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?: Yes
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 Michael Grandjean univentionstaff 2020-11-17 16:11:26 CET
# univention-app info
UCS: 4.4-6 errata780
Installed: letsencrypt=1.2.2-8 pkgdb=11.0 prometheus-node-exporter=1.1 samba4=4.10 ucsschool=4.4 v7
Upgradable:

When starting an exam, we create exam-users by copying the original users of the assigned class/workgroup. The original users are then denied to login to the windows clients in the classroom and only the exam-users are allowed to login.

Imho it would be better if we (optionally?) *deactivate* the original users during the exam instead of just preventing the login to the windows clients. This should prevent that the original user can still be used to login to other connected services that might not be blocked by the proxy (e.g. local Nextcloud/ownCloud/moodle/Webmail ...).
Comment 2 Michael Salm 2020-12-14 16:35:23 CET
This would be very useful.
Comment 3 Erik Damrose univentionstaff 2020-12-14 16:42:34 CET
We cannot do this by default, it has to be an option in e.g. UCR. Administrators must check carefully what deactivating a user means for services that are connected to UCS.

Some Apps may delete disabled users, no mail might be received for disabled users, ...
Comment 4 Daniel Tröder univentionstaff 2020-12-15 07:59:38 CET
I think a (Python) "post exam-user create" hook would be best suited for this.
We could deliver the one asked for by the OP (deactivate the complete original user).
Where required a hook could be written that deactivates just the login to selected services, instead of deactivating the complete user, or implementing other scenarios.
Comment 5 Patrick Ziegler univentionstaff 2021-01-08 09:00:02 CET
Added to backlog: https://taiga.knut.univention.de/project/oschwieg-ucs-5/us/4551
Comment 7 Toni Röhmeyer univentionstaff 2021-01-20 15:29:19 CET
Patch has been implemented on branch troehmey/bug52372_deactivate_user_during_exam:

717709a13 Bug #52372: disable user during exam mode


* A new UCRV "ucsschool/exam/user/disable" is used to check if the original user should be disabled during an exam.
* If this variable is set True, the original user gets disabled during an exam (done in ucs-school-umc-exam/umc/python/schoolexam-master/__init__.py)
* A ucs-test "101_exam_mode_deactivate_user.py" checks this behavior
Comment 8 Toni Röhmeyer univentionstaff 2021-01-21 15:44:41 CET
Applied fixup:

f23c30987 Bug #52372: make test independent from current ucrv value

Before, the test depended on that current value of ucsschool/exam/user/disable
Comment 9 Toni Röhmeyer univentionstaff 2021-01-25 13:44:03 CET
Added explanation for the new UCRV to doc with

035ef1239 Bug #52372: add ucrv explaination to admin manual
Comment 10 Daniel Tröder univentionstaff 2021-01-26 12:57:16 CET
* Please note my comments on gitlab.
* The test does not work in a multi-serve setup, as it runs on the school server but the UCRV is required on the dc master.
Comment 11 Daniel Tröder univentionstaff 2021-01-26 13:18:45 CET
But it succeeds on a singleserver.
* Simply add "ucs-school-singlemaster" to the "packages" requirement at the top.

* The UCRV description is in the wrong package. It belongs into the master package.

OK: automated test on singleserver
OK: manual test on singleserver
OK: manual test on multi server

Please do the aforementioned code changes, rebase from 4.4, squash all commits into 1 and merge them to 4.4; build; advisory.
Comment 12 Toni Röhmeyer univentionstaff 2021-01-26 15:11:26 CET
I applied and tested the suggested changes.

Feature branch troehmey/bug52372_deactivate_user_during_exam merged to 4.4 with commits:

e28b0b352 Bug #52372: added advisories
694619a3c Bug #52372: added changelogs
981f95031 Bug #52372: Merge branch 'troehmey/bug52372_deactivate_user_during_exam' into 4.4
ae35a01f8 Bug #52372: disable user during exam mode


Succesful builds:

Package: ucs-school-umc-exam
Version: 9.0.1-47A~4.4.0.202101261500
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package: ucs-test-ucsschool
Version: 6.0.179A~4.4.0.202101261505
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Doc:
https://jenkins.knut.univention.de:8181/job/UCSschool-4.4/job/Handbook/62/
Comment 13 Daniel Tröder univentionstaff 2021-01-26 16:03:36 CET
Please restore the original user also in ucs-school-umc-exam/share/exam-and-room-cleanup → restore_original_user().
Comment 14 Toni Röhmeyer univentionstaff 2021-01-26 17:17:18 CET
User gets enabled in school-umc-exam/share/exam-and-room-cleanup.

[4.4] 8ce166ad3 Bug #52372: restore original user in exam-cleanup


However, it is questionable if a user should just be activated after an exam.
We should discuss if it would be better to somehow store the old disabled-value of the original user.
Comment 15 Toni Röhmeyer univentionstaff 2021-01-27 10:05:28 CET
Updated build version due to small fix:

3b08d59a7 Bug #52372: updated build version
1ad2ecc97 Bug #52372: added changelog entry


Successful build:

Package: ucs-school-umc-exam
Version: 9.0.1-48A~4.4.0.202101271000
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 16 Daniel Tröder univentionstaff 2021-01-28 16:03:07 CET
OK: cleanup script restores original users "deactivated" state to false
OK: build and advisory
Comment 17 Ole Schwiegert univentionstaff 2021-02-03 11:10:27 CET
Errata updates for UCS@school 4.4 v8 have been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v8-de.html

If this error occurs again, please clone this bug.