From a32ad580a7a6cb3aec84c1bdd82355323711f142 Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Tue, 19 Aug 2025 14:38:16 +0200 Subject: [PATCH] =?UTF-8?q?Dissocier=20l=E2=80=99=C3=A9tab=20de=20l?= =?UTF-8?q?=E2=80=99OU=20sp=C3=A9cifique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches.d/scribe-backend.patch | 42 ++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/patches.d/scribe-backend.patch b/patches.d/scribe-backend.patch index bbd0a47..7b7aa79 100644 --- a/patches.d/scribe-backend.patch +++ b/patches.d/scribe-backend.patch @@ -73,7 +73,7 @@ index 0db4982..47f5c80 100755 nscd_start() log.del_lock() diff --git usr/lib/python3/dist-packages/scribe/enseignants.py usr/lib/python3/dist-packages/scribe/enseignants.py -index 69f3411..97bf905 100644 +index 69f3411..a5db6da 100644 --- usr/lib/python3/dist-packages/scribe/enseignants.py +++ usr/lib/python3/dist-packages/scribe/enseignants.py @@ -145,45 +145,37 @@ class Enseignant(User): @@ -148,6 +148,21 @@ index 69f3411..97bf905 100644 """ Mise à niveau d'un compte enseignant """ +@@ -326,10 +318,14 @@ class Enseignant(User): + return res + + def _is_enseignant(self, uid): + """ + test si l'utilisateur existe dans l'annuaire + """ + uidfilter = "(&%s(uid=%s))" % (PROF_FILTER, uid) + if self.ldap_admin._search_one(uidfilter): + return True + return False ++ ++ ++ def get_etab(self, login, multi_etabs=False): ++ return '00000000' diff --git usr/lib/python3/dist-packages/scribe/eoleldap.py usr/lib/python3/dist-packages/scribe/eoleldap.py index 45ec338..9a67c6d 100644 --- usr/lib/python3/dist-packages/scribe/eoleldap.py @@ -212,9 +227,32 @@ index 45ec338..9a67c6d 100644 res = self.ldap_admin._search("(&%s%s)" % (USER_FILTER, filtre), attrs) for user in res: diff --git usr/lib/python3/dist-packages/scribe/eoleuser.py usr/lib/python3/dist-packages/scribe/eoleuser.py -index 05569fd..c092698 100644 +index 05569fd..b4e24e5 100644 --- usr/lib/python3/dist-packages/scribe/eoleuser.py +++ usr/lib/python3/dist-packages/scribe/eoleuser.py +@@ -329,21 +329,21 @@ class User(LdapEntry): + """ + return {} + + def exec_smbldap_useradd(self, user_add_args, login): + """ + exécute smbldap-useradd + """ + cmd = ["/usr/sbin/smbldap-useradd"] + cmd.extend(self.user_add_params) + cmd.extend(user_add_args) +- etab = self.get_etab(login) ++ etab = self.get_etab(login, multi_etab=SUPPORT_ETAB) + force_dn = {'groupsdn="ou=local,ou=Groupes,${etab},${suffix}"': 'groupsdn="${suffix}"'} + tool.launch_smbldap_tool(cmd, num_etab, etab, force_dn=force_dn) + + def _add_perso(self, login, **args): + """ + Crée les différents répertoires de l'utilisateur + """ + pass + + def _add_scribe_user(self, login, **args): @@ -410,20 +410,25 @@ class User(LdapEntry): grp = Group() grp.ldap_admin = self.ldap_admin