Chercher les enseignants dans les groupes plutôt que dans la branche
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
diff --git usr/bin/importation_scribe usr/bin/importation_scribe
|
diff --git usr/bin/importation_scribe usr/bin/importation_scribe
|
||||||
index 0db4982..c1cb947 100755
|
index 0db4982..8d1cb6f 100755
|
||||||
--- usr/bin/importation_scribe
|
--- usr/bin/importation_scribe
|
||||||
+++ usr/bin/importation_scribe
|
+++ usr/bin/importation_scribe
|
||||||
@@ -42,21 +42,22 @@ choix de la source de données et imports
|
@@ -42,20 +42,22 @@ choix de la source de données et imports
|
||||||
- personnels administratifs
|
- personnels administratifs
|
||||||
- comptes invités
|
- comptes invités
|
||||||
|
|
||||||
@@ -13,9 +13,9 @@ index 0db4982..c1cb947 100755
|
|||||||
from pyeole.process import system_out, system_code
|
from pyeole.process import system_out, system_code
|
||||||
from scribe.storage import init_store
|
from scribe.storage import init_store
|
||||||
from scribe.eoleldap import Ldap
|
from scribe.eoleldap import Ldap
|
||||||
-from scribe.ldapconf import SUPPORT_ETAB
|
|
||||||
+from scribe.eoleuser import User
|
+from scribe.eoleuser import User
|
||||||
+from scribe.ldapconf import SUPPORT_ETAB, PROF_FILTER, BRANCHE_ETAB
|
+from scribe.enseignant import Enseignant
|
||||||
|
from scribe.ldapconf import SUPPORT_ETAB
|
||||||
from scribe.eoletools import nscd_start, nscd_stop
|
from scribe.eoletools import nscd_start, nscd_stop
|
||||||
from scribe.parsing import sconet, aaf, be1d, scribecsv2
|
from scribe.parsing import sconet, aaf, be1d, scribecsv2
|
||||||
from scribe.importation import preferences, writer, config
|
from scribe.importation import preferences, writer, config
|
||||||
@@ -25,8 +25,35 @@ index 0db4982..c1cb947 100755
|
|||||||
# utilitaires de manipulation de la console
|
# utilitaires de manipulation de la console
|
||||||
|
|
||||||
class OutOfRange(Exception):
|
class OutOfRange(Exception):
|
||||||
""" Exception OutOfRange """
|
@@ -198,21 +200,23 @@ def ask_administratifs_prefs():
|
||||||
@@ -458,33 +459,45 @@ class Console:
|
ask_prefs(preferences.get_administratifs_prefs())
|
||||||
|
|
||||||
|
def ask_invites_prefs():
|
||||||
|
"""
|
||||||
|
préférences comptes invités
|
||||||
|
"""
|
||||||
|
print("*************************")
|
||||||
|
print("** Préférences Invités **")
|
||||||
|
print("*************************")
|
||||||
|
print()
|
||||||
|
- ask_prefs(preferences.get_invites_prefs())
|
||||||
|
+ prefs = preferences.get_invites_prefs()
|
||||||
|
+ if not isfile(prefs):
|
||||||
|
+ ask_prefs(preferences.get_invites_prefs())
|
||||||
|
|
||||||
|
|
||||||
|
#______________________________________________________________________________
|
||||||
|
|
||||||
|
class Console:
|
||||||
|
"""
|
||||||
|
Questions à utiliser en mode console
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
@@ -455,36 +459,49 @@ class Console:
|
||||||
|
def do_write_enseignant(self):
|
||||||
|
"""
|
||||||
|
écriture des enseignants
|
||||||
"""
|
"""
|
||||||
log.add_lock()
|
log.add_lock()
|
||||||
log.debuglog("Arrêt de LSC...", title=True)
|
log.debuglog("Arrêt de LSC...", title=True)
|
||||||
@@ -34,13 +61,14 @@ index 0db4982..c1cb947 100755
|
|||||||
connexion = Ldap()
|
connexion = Ldap()
|
||||||
connexion.connect()
|
connexion.connect()
|
||||||
if SUPPORT_ETAB:
|
if SUPPORT_ETAB:
|
||||||
|
+ enseignant = Enseignant()
|
||||||
|
+ enseignant.ldap_admin = connexion
|
||||||
prefs = preferences.get_enseignants_prefs()
|
prefs = preferences.get_enseignants_prefs()
|
||||||
etab = prefs.get_default('etab')
|
etab = prefs.get_default('etab')
|
||||||
etab_prefix = prefs.get_default('etab_prefix')
|
etab_prefix = prefs.get_default('etab_prefix')
|
||||||
+ purge_option = 'keep'
|
+ old_logins = connexion._search(f'(&(objectClass=eolegroupe)(type=etablissement)(cn={etab}))', ['memberUid'])
|
||||||
+ suffix=BRANCHE_ETAB % {'etab': etab}
|
+ if old_logins:
|
||||||
+ old_logins = connexion._search('(&{})'.format(PROF_FILTER), 'uid', suffix=suffix)
|
+ old_logins = [ol for ol in old_logins[1].get('memberUid', []) if enseignant._is_enseignant(ol)]
|
||||||
+
|
|
||||||
else:
|
else:
|
||||||
etab = None
|
etab = None
|
||||||
etab_prefix = ''
|
etab_prefix = ''
|
||||||
|
Reference in New Issue
Block a user