From 75d935aa57e6771073442188eae3b7c42e681516 Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 9 May 2022 13:51:33 +0200 Subject: [PATCH] Synchronisation scribe niveaux + eleves classes + profs classes (ref #34132) --- .../CoreBundle/Command/SynchroCommand.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php index 50459f9d..362b2335 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -142,6 +142,19 @@ class SynchroCommand extends Command $this->writeln(" - $label"); if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); + // Niveaux + $this->writeln(''); + $this->writeln('== NIVEAUX =========================================='); + $results = $this->ldap->search("type=Niveau", ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(&(type=Niveau)(cn=$cn))"; + + $label="NIVEAU - ".$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); + } + // Classes $this->writeln(''); $this->writeln('== CLASSES =========================================='); @@ -155,6 +168,32 @@ class SynchroCommand extends Command if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } + // Elèves des Classes + $this->writeln(''); + $this->writeln('== ELEVES DES CLASSES =========================================='); + $results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(&(type=Classe)(cn=$cn))"; + + $label="ELEVES DE LA CLASSE - ".$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); + } + + // Professeurs des Classes + $this->writeln(''); + $this->writeln('== PROFESSEURS DES CLASSES =========================================='); + $results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(|(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))"; + + $label="PROFESSEURS DE LA CLASSE - ".$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); + } + // Options $this->writeln(''); $this->writeln('== OPTIONS ==========================================');