From d2a6bf4f27ef91e0e6fcd002a402c40439f4cf42 Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Thu, 28 Aug 2025 14:12:36 +0200 Subject: [PATCH] =?UTF-8?q?Retirer=20=C3=A9galement=20les=20classes=20de?= =?UTF-8?q?=20l=E2=80=99attribut=20Divcod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches.d/scribe-backend.patch | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/patches.d/scribe-backend.patch b/patches.d/scribe-backend.patch index 3d173a5..418defc 100644 --- a/patches.d/scribe-backend.patch +++ b/patches.d/scribe-backend.patch @@ -1,5 +1,5 @@ diff --git usr/bin/importation_scribe usr/bin/importation_scribe -index 0db4982..4fa2fab 100755 +index 0db4982..889dc03 100755 --- usr/bin/importation_scribe +++ usr/bin/importation_scribe @@ -42,20 +42,22 @@ choix de la source de données et imports @@ -50,7 +50,7 @@ index 0db4982..4fa2fab 100755 """ def __init__(self): -@@ -455,36 +459,49 @@ class Console: +@@ -455,36 +459,48 @@ class Console: def do_write_enseignant(self): """ écriture des enseignants @@ -89,7 +89,6 @@ index 0db4982..4fa2fab 100755 + user.ldap_admin = connexion + obsolete_logins = [login for login in old_logins if login not in logins] + for obsolete_login in obsolete_logins: -+ # eoleusers from dns and eoleuser._quit_etab + user._quit_etab(obsolete_login, etab=etab) if self.data_type in ['sconet', 'aaf']: writer.write_service(store=self.store, connexion=connexion, @@ -298,7 +297,7 @@ index 45ec338..0ec3129 100644 else: raise Exception('Unknown mode') diff --git usr/lib/python3/dist-packages/scribe/eoleuser.py usr/lib/python3/dist-packages/scribe/eoleuser.py -index 05569fd..3cafe9f 100644 +index 05569fd..102044a 100644 --- usr/lib/python3/dist-packages/scribe/eoleuser.py +++ usr/lib/python3/dist-packages/scribe/eoleuser.py @@ -361,23 +361,25 @@ class User(LdapEntry): @@ -328,7 +327,7 @@ index 05569fd..3cafe9f 100644 gtype = grp.c_get_group_type(groupe) if self.profil != 'eleve' and gtype in ['Classe', 'Niveau', 'Option']: # groupes réservés élèves -@@ -410,20 +412,25 @@ class User(LdapEntry): +@@ -410,20 +412,32 @@ class User(LdapEntry): grp = Group() grp.ldap_admin = self.ldap_admin if touch: @@ -343,6 +342,13 @@ index 05569fd..3cafe9f 100644 + self._desinscription(user, etab, sync=True) + for grp in self._get_user_groups(user, etab): + self._desinscription(user, grp, sync=True) ++ grp = Group() ++ divcods = [dv for dv in self.get_attr(user, 'Divcod') ++ if grp.get_etab_from_group(dv) != etab] ++ self.set_attr(user, 'Divcod', divcods) ++ ++ ++ + def _gen_ftpdir(self, login): """ @@ -354,7 +360,7 @@ index 05569fd..3cafe9f 100644 rmtree(ftpdir) makedirs(ftpdir, 0o500) system('/bin/chown %s %s' % (login, ftpdir)) -@@ -594,27 +601,27 @@ class User(LdapEntry): +@@ -594,27 +608,27 @@ class User(LdapEntry): authldap = Ldap(binddn=user_dn, passwd=password) try: