Bug 56581 - Users are not removed from old groups when moved to limbo / transfer school
Users are not removed from old groups when moved to limbo / transfer school
Status: ASSIGNED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Alexander Steffen
Johannes Königer
:
Depends on: 50231
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-13 15:49 CEST by Stefan Gohmann
Modified: 2024-02-08 13:50 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023090621000257, 2023082821000244, 2023091121000283
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 Stefan Gohmann univentionstaff 2023-09-13 15:49:20 CEST
It looks like users who are moved to the limbo / transfer school are not removed from every school group.

The result is that the password reset for the previous classes or working groups don't work.
Comment 3 Stefan Gohmann univentionstaff 2023-09-15 15:59:35 CEST
If someone has a similar problem, I wrote a simple shell script which shows the udm commands:

cat remove-transfer-users-from-groups.sh

#!/bin/bash

eval $(ucr shell)

univention-ldapsearch -b "ou=transfer,$ldap_base" '(&(ucsschoolRole=student:school:transfer)(uid=*))' dn  | ldapsearch-wrapper | sed -ne 's|^dn: uid|uid|p' | while read u_dn; do
    univention-ldapsearch "(uniqueMember=$u_dn)" dn | ldapsearch-wrapper | sed -ne 's|^dn: cn|cn|p' | while read g_dn; do
        transfer="$(echo $g_dn | grep ',ou=transfer,')";
        if [ -n "$transfer" ]; then continue; fi;
        echo udm users/user modify --dn \"$u_dn\" --remove groups=\"$g_dn\";
        #  udm users/user modify --dn "$u_dn" --remove groups="$g_dn";
    done;
done