From d0d8183f7a2b3328659977e8c981c7a91a1b0842 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 6 Jul 2022 11:11:59 +0200 Subject: [PATCH] =?UTF-8?q?ne=20plus=20concid=C3=A8rer=20les=20profils=20s?= =?UTF-8?q?cribe=20comme=20des=20groupes=20de=20travail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreBundle/Command/ScriptCommand.php | 28 +++++++++++++++++++ .../CoreBundle/Command/SynchroCommand.php | 4 +-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php index 5d277ef9..a24463c4 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php @@ -180,6 +180,20 @@ class ScriptCommand extends Command $this->writeln(""); } + if($this->container->getParameter('ldap_template')=="scribe") { + $script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"purgepageprofil"]); + if(!$script) { + $this->writeln("== SCRIPT = purgepageprofil"); + $this->purgepageprofil(); + + $script=new Script(); + $script->setName("purgepageprofil"); + $this->em->persist($script); + $this->em->flush(); + $this->writeln(""); + } + } + return 1; } @@ -434,6 +448,20 @@ class ScriptCommand extends Command } } + private function purgepageprofil() { + $page=$this->em->getRepository('CadolesPortalBundle:Page')->findOneBy(['name'=>'PROFIL - Enseignants']); + if($page) { + $this->em->remove($page); + $this->em->flush(); + } + + $page=$this->em->getRepository('CadolesPortalBundle:Page')->findOneBy(['name'=>'PROFIL - Administratifs']); + if($page) { + $this->em->remove($page); + $this->em->flush(); + } + } + 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 58711ec7..819686bc 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -128,7 +128,7 @@ class SynchroCommand extends Command $ldapfilter="(|(&(uid=*)(ENTPersonProfils=enseignant))(&(uid=*)(typeadmin=0))(&(uid=*)(typeadmin=2)))"; $label="PROFIL - Enseignants"; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); // Responsables $ldapfilter="(&(uid=*)(ENTPersonProfils=responsable))"; @@ -140,7 +140,7 @@ class SynchroCommand extends Command $ldapfilter="(&(uid=*)(ENTPersonProfils=administratif))"; $label="PROFIL - Administratifs"; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); // Niveaux $this->writeln('');