Synchronisation scribe niveaux + eleves classes + profs classes (ref #34132)

This commit is contained in:
afornerot 2022-05-09 13:51:33 +02:00
parent 27e23fffaf
commit 75d935aa57
1 changed files with 39 additions and 0 deletions

View File

@ -142,6 +142,19 @@ class SynchroCommand extends Command
$this->writeln(" - $label"); $this->writeln(" - $label");
if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); 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 // Classes
$this->writeln(''); $this->writeln('');
$this->writeln('== CLASSES =========================================='); $this->writeln('== CLASSES ==========================================');
@ -155,6 +168,32 @@ class SynchroCommand extends Command
if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); 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 // Options
$this->writeln(''); $this->writeln('');
$this->writeln('== OPTIONS =========================================='); $this->writeln('== OPTIONS ==========================================');