From 210b669909b578468e94aa01f8cfba5bd5b01b4f Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 9 Oct 2019 17:01:41 +0200 Subject: [PATCH 1/3] =?UTF-8?q?mise=20=C3=A0=20jour=20pour=20rest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../CoreBundle/Controller/RestController.php | 13 ++ .../public/themes/transnum/style.css | 2 +- .../CoreBundle/Resources/views/base.html.twig | 2 +- .../CronBundle/Command/InitDataCommand.php | 131 +----------------- .../Resources/views/Chat/client.html.twig | 2 +- 6 files changed, 23 insertions(+), 129 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 1b2bd43d..8b485653 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}M+3m6aLkROJycqRqpYLqd0X6BOfvLMZm +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}oHrljV00WDOVTiNtiKKmRtI13Y7XhUSj ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php index 480d0b3d..440b12f0 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php @@ -54,6 +54,7 @@ class RestController extends Controller $output["bookmarks"] = []; $output["items"] = []; $output["itemcategorys"] = []; + $output["groups"] = []; $bookmarks=null; $items=null; @@ -61,6 +62,7 @@ class RestController extends Controller $weburl="https://".$this->getParameter("weburl")."/".$this->getParameter("alias")."/"; $em->getRepository("CadolesPortalBundle:Item")->getUserItems($user,$bookmarks,$items,$itemcategorys,null,3); + $this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$entity,$pagesuser,$pagesadmin,$groupsshared); // Construction de la réponse $output["user"]["firstname"] = $user->getFirstname(); @@ -69,6 +71,7 @@ class RestController extends Controller $output["user"]["avatar"] = $weburl."uploads/avatar/".$user->getAvatar(); $output["user"]["niveau01"] = $user->getNiveau01()->getLabel(); $output["user"]["niveau02"] = ($user->getNiveau02()?$user->getNiveau02()->getLabel():null); + $output["user"]["role"] = $user->getRole(); if($bookmarks) { foreach($bookmarks as $bookmark) { @@ -114,6 +117,16 @@ class RestController extends Controller } } + if($groupsshared) { + foreach($groupsshared as $groupshared) { + $tmp=[]; + $tmp["id"] = $groupshared->getId(); + $tmp["title"] = $groupshared->getLabel(); + + array_push($output["groups"],$tmp); + } + } + // Retour diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css index ff534bf6..78ce34bb 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/style.css @@ -72,7 +72,7 @@ body.simple { .grid .grid-preview { width: 15%; - min-width: 142px; + min-width: 138px; } .grid .grid-preview .grid-item-title { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/base.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/base.html.twig index 1fcf1279..c8410877 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/base.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/base.html.twig @@ -133,7 +133,7 @@ -
+
{% block pagewrapper %} diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php index 78850123..8326303b 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php @@ -42,6 +42,12 @@ class InitDataCommand extends ContainerAwareCommand } protected function insertCron() { + + // afin de forcer les ID sur certaines entités + $metadata = $this->entityManager->getClassMetaData(get_class($entity)); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); + $metadata->setIdGenerator(new AssignedGenerator()); + // Job Mail // Toute les minutes $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1); @@ -59,131 +65,6 @@ class InitDataCommand extends ContainerAwareCommand $this->entityManager->persist($entity); } - - // afin de forcer les ID sur certaines entités - $metadata = $this->entityManager->getClassMetaData(get_class($entity)); - $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); - $metadata->setIdGenerator(new AssignedGenerator()); - - // Job synchronisation des comptes utilisateur - // Toute les 24h à 3h00 - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(100); - if(!$entity) { - $entity = new Cron; - $nextdate=$entity->getSubmitdate(); - $nextdate->setTime(3,0); - $entity->setCommand("Core:Synchro"); - $entity->setDescription("Synchronisation des Comptes Utilisateurs"); - $entity->setId(100); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(86400); - $entity->setNextexecdate($nextdate); - $entity->setJsonargument('{"simulate":"false"}'); - $this->entityManager->persist($entity); - } - - // Job purge des registrations obsolètes - // Toute les 5mn - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(110); - if(!$entity) { - $entity = new Cron; - $entity->setCommand("Core:PurgeRegistration"); - $entity->setDescription("Purge des Inscriptions obsolètes"); - $entity->setId(110); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(300); - $entity->setNextexecdate($entity->getSubmitdate()); - $this->entityManager->persist($entity); - } - - // Job de purge des fichiers obsolète - // Toute les 24h à 3h00 - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(200); - if(!$entity) { - $entity = new Cron; - $nextdate=$entity->getSubmitdate(); - $nextdate->setTime(3,0); - $entity->setCommand("Core:PurgeFile"); - $entity->setDescription("Suppression des fichiers obsolètes"); - $entity->setId(200); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(86400); - $entity->setNextexecdate($nextdate); - $this->entityManager->persist($entity); - } - - // CRON PORTAIL - // Job purge des registrations obsolètes - // Toute les 5mn - $portal_activate = $this->getContainer()->getParameter('portal_activate'); - $calendar_activate = $this->getContainer()->getParameter('calendar_activate'); - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1000); - if(!$entity&&($portal_activate||$calendar_activate)) { - $entity = new Cron; - $entity->setCommand("Portal:SynchroICS"); - $entity->setDescription("Synchronisation des Calendriers Utilisateurs liés à une URL ICS"); - $entity->setId(1000); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(600); - $entity->setNextexecdate($entity->getSubmitdate()); - $this->entityManager->persist($entity); - } - elseif($entity&&!($portal_activate||$calendar_activate)) { - $this->entityManager->remove($entity); - } - - // Job de récupération des sondages Limesurvey - // Toute les 6h - $activate_widlimesurvey = $this->getContainer()->getParameter('activate_widlimesurvey'); - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1010); - if(!$entity&&$activate_widlimesurvey) { - $entity = new Cron; - $nextdate=$entity->getSubmitdate(); - $nextdate->setTime(1,0); - $entity->setCommand("Portal:GetLimesurvey"); - $entity->setDescription("Récupération des sondages Limesurvey"); - $entity->setId(1010); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(21600); - $entity->setNextexecdate($nextdate); - $this->entityManager->persist($entity); - } - elseif($entity&&!$activate_widlimesurvey) { - $this->entityManager->remove($entity); - } - - // Job de récupération des cours Moodle - // Toute les 6h - $activate_widmoodle = $this->getContainer()->getParameter('activate_widmoodle'); - $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1020); - if(!$entity&&$activate_widmoodle) { - $entity = new Cron; - $nextdate=$entity->getSubmitdate(); - $nextdate->setTime(1,0); - $entity->setCommand("Portal:GetMoodle"); - $entity->setDescription("Récupération des cours Moodle "); - $entity->setId(1020); - $entity->setStatut(2); - $entity->setRepeatcall(0); - $entity->setRepeatexec(0); - $entity->setRepeatinterval(21600); - $entity->setNextexecdate($nextdate); - $this->entityManager->persist($entity); - } - elseif($entity&&!$activate_widmoodle) { - $this->entityManager->remove($entity); - } - $this->entityManager->flush(); } } diff --git a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig index 245b6b8f..3208b15d 100644 --- a/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig +++ b/src/ninegate-1.0/src/Cadoles/WebsocketBundle/Resources/views/Chat/client.html.twig @@ -9,7 +9,7 @@ } {% else %} #page-wrapper { - //padding: 5px 25px 0px 15px; + padding: 5px 25px 0px 15px; //background: transparent; } {% endif %} From e9b2f694fa24955f40f1f62491d47c403f5e3b44 Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 14 Oct 2019 13:30:50 +0200 Subject: [PATCH 2/3] svg --- .../CoreBundle/Command/SynchroCommand.php | 2 +- .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../CoreBundle/Resources/config/services.yml | 5 +- .../CronBundle/Command/CronCommand.php | 2 - .../CronBundle/Command/InitDataCommand.php | 125 +++++++++++++++++- .../Resources/config/services.yml | 2 +- 6 files changed, 125 insertions(+), 13 deletions(-) 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 1bcbdef4..2a8245a5 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -620,7 +620,7 @@ class SynchroCommand extends Command $criteria = '(cn=*)'; $subbranch=$baseGroup; - $results = $this->search($criteria, array('cn'), $subbranch); + $results = $this->ldap->search($criteria, array('cn'), $subbranch); foreach($results as $result) { $data = $this->em->getRepository('CadolesCoreBundle:Group')->findBy(array('label' => $result["cn"])); if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 8b485653..3540b39b 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}oHrljV00WDOVTiNtiKKmRtI13Y7XhUSj +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}dRJCAXfIVqY9JEXjlinWAYEWdQSse65o ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml index a2aeea7f..384c2323 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/services.yml @@ -127,4 +127,7 @@ services: cadoles.saml_attribute_mapper: public: true - class: Cadoles\CoreBundle\Service\samlAttributeMapperService \ No newline at end of file + class: Cadoles\CoreBundle\Service\samlAttributeMapperService + + + \ No newline at end of file diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php index 2eddad8f..451c8a95 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php @@ -48,8 +48,6 @@ class CronCommand extends ContainerAwareCommand return 0; } - $this->filesystem->appendToFile($this->rootlog.'cron.lock', "lock"); - $crons = $entityManager->getRepository('CadolesCronBundle:Cron')->toexec(); $i=0; diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php index 8326303b..67930ee0 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php @@ -42,12 +42,6 @@ class InitDataCommand extends ContainerAwareCommand } protected function insertCron() { - - // afin de forcer les ID sur certaines entités - $metadata = $this->entityManager->getClassMetaData(get_class($entity)); - $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); - $metadata->setIdGenerator(new AssignedGenerator()); - // Job Mail // Toute les minutes $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1); @@ -64,7 +58,124 @@ class InitDataCommand extends ContainerAwareCommand $entity->setJsonargument('{"message-limit":"100","env":"prod"}'); $this->entityManager->persist($entity); } - + // afin de forcer les ID sur certaines entités + $metadata = $this->entityManager->getClassMetaData(get_class($entity)); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); + $metadata->setIdGenerator(new AssignedGenerator()); + + // Job synchronisation des comptes utilisateur + // Toute les 24h à 3h00 + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(100); + if(!$entity) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(3,0); + $entity->setCommand("Core:Synchro"); + $entity->setDescription("Synchronisation des Comptes Utilisateurs"); + $entity->setId(100); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(86400); + $entity->setNextexecdate($nextdate); + $entity->setJsonargument('{"simulate":"false"}'); + $this->entityManager->persist($entity); + } + // Job purge des registrations obsolètes + // Toute les 5mn + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(110); + if(!$entity) { + $entity = new Cron; + $entity->setCommand("Core:PurgeRegistration"); + $entity->setDescription("Purge des Inscriptions obsolètes"); + $entity->setId(110); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(300); + $entity->setNextexecdate($entity->getSubmitdate()); + $this->entityManager->persist($entity); + } + // Job de purge des fichiers obsolète + // Toute les 24h à 3h00 + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(200); + if(!$entity) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(3,0); + $entity->setCommand("Core:PurgeFile"); + $entity->setDescription("Suppression des fichiers obsolètes"); + $entity->setId(200); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(86400); + $entity->setNextexecdate($nextdate); + $this->entityManager->persist($entity); + } + // CRON PORTAIL + // Job purge des registrations obsolètes + // Toute les 5mn + $portal_activate = $this->getContainer()->getParameter('portal_activate'); + $calendar_activate = $this->getContainer()->getParameter('calendar_activate'); + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1000); + if(!$entity&&($portal_activate||$calendar_activate)) { + $entity = new Cron; + $entity->setCommand("Portal:SynchroICS"); + $entity->setDescription("Synchronisation des Calendriers Utilisateurs liés à une URL ICS"); + $entity->setId(1000); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(600); + $entity->setNextexecdate($entity->getSubmitdate()); + $this->entityManager->persist($entity); + } + elseif($entity&&!($portal_activate||$calendar_activate)) { + $this->entityManager->remove($entity); + } + // Job de récupération des sondages Limesurvey + // Toute les 6h + $activate_widlimesurvey = $this->getContainer()->getParameter('activate_widlimesurvey'); + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1010); + if(!$entity&&$activate_widlimesurvey) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(1,0); + $entity->setCommand("Portal:GetLimesurvey"); + $entity->setDescription("Récupération des sondages Limesurvey"); + $entity->setId(1010); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(21600); + $entity->setNextexecdate($nextdate); + $this->entityManager->persist($entity); + } + elseif($entity&&!$activate_widlimesurvey) { + $this->entityManager->remove($entity); + } + // Job de récupération des cours Moodle + // Toute les 6h + $activate_widmoodle = $this->getContainer()->getParameter('activate_widmoodle'); + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1020); + if(!$entity&&$activate_widmoodle) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(1,0); + $entity->setCommand("Portal:GetMoodle"); + $entity->setDescription("Récupération des cours Moodle "); + $entity->setId(1020); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(21600); + $entity->setNextexecdate($nextdate); + $this->entityManager->persist($entity); + } + elseif($entity&&!$activate_widmoodle) { + $this->entityManager->remove($entity); + } $this->entityManager->flush(); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml index 66baa510..56f25a36 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/config/services.yml @@ -3,4 +3,4 @@ services: public: true arguments: ['@service_container'] tags: - - { name: form.type } \ No newline at end of file + - { name: form.type } From abd323163eec3a245c7efc36553c2e6118ed22dc Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 15 Oct 2019 10:02:33 +0200 Subject: [PATCH 3/3] svg modele scribe --- .../CoreBundle/Command/InitDataCommand.php | 8 +++++- .../CoreBundle/Command/SynchroCommand.php | 27 +++++++++++++++++++ .../CoreBundle/Command/data/core-init-01.sql | 6 ++--- .../CronBundle/Command/CronCommand.php | 17 ++++++++++++ .../CronBundle/Command/InitDataCommand.php | 10 ++++--- 5 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php index eb1b4028..70bd2368 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php @@ -38,6 +38,7 @@ class InitDataCommand extends ContainerAwareCommand $em = $this->getContainer()->get('doctrine')->getEntityManager(); $masteridentity=$this->getContainer()->getParameter('masteridentity'); + $ldap_template = $this->getContainer()->getParameter('ldap_template'); $finder = new Finder(); $finder->in('src/Cadoles/CoreBundle/Command/data'); @@ -138,7 +139,12 @@ class InitDataCommand extends ContainerAwareCommand if(!$niveau01) { // Si ce n'est pas le cas on positionne un filtre ultra large sur le niveau01 de base $niveau01=$group=$em->getRepository('CadolesCoreBundle:Niveau01')->find(-100); - $niveau01->setLdapfilter("(uid=*)"); + + if($ldap_template=="scribe") + $niveau01->setLdapfilter("(&(uid=*)(objectclass=inetOrgPerson)(!(description=Computer)))"); + else + $niveau01->setLdapfilter("(uid=*)"); + $em->persist($niveau01); $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 2a8245a5..308e9895 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -132,6 +132,7 @@ class SynchroCommand extends Command $this->writeln(" - $label"); if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + // Classes $this->writeln(''); $this->writeln('== CLASSES =========================================='); $results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn); @@ -143,6 +144,32 @@ class SynchroCommand extends Command $this->writeln(" - $label"); if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); } + + // Options + $this->writeln(''); + $this->writeln('== OPTIONS =========================================='); + $results = $this->ldap->search("type=Option", ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(|(&(type=Option)(cn=$cn))(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))"; + + $label="OPTION = ".$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + } + + // Groupes + $this->writeln(''); + $this->writeln('== GROUPES =========================================='); + $results = $this->ldap->search("type=Groupe", ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(&(type=Groupe)(cn=$cn))"; + + $label="GROUPE = ".$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + } } $this->writeln(''); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 3540b39b..e8e84a60 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -5,11 +5,10 @@ SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES -(-100, 'DRAAF', '130007107'); +(-100, 'scribe26', '0000000A'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}dRJCAXfIVqY9JEXjlinWAYEWdQSse65o -', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); +(-100, -100, 'admin', 'Administrateur', 'scribe26', 'PWD_CAS', 'admin@scribe26.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '0000000A', 'simple'); @@ -25,7 +24,6 @@ INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `f (1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN,ROLE_MODO', ''), (1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN,ROLE_MODO', ''), -(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), (1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO', ''), (1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO', ''), (1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO', ''), diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php index 451c8a95..16f254d0 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php @@ -63,8 +63,21 @@ class CronCommand extends ContainerAwareCommand $this->writeln ('Date = '.$now->format('Y-m-d H:i:s')); } + // Cas particulier de la synchro + // Dans la synchro il y a un clear du manager ce qui perturbe totalement le manager de Core:Exec + // Il pert le lien avec la boucle sur crons + // Alors si dans le cron il y a la synchro alors on n'execute que lui le reste sera executé lors du prochain passage + $cronsynchro=$entityManager->getRepository('CadolesCronBundle:Cron')->find(100); + if($cronsynchro&&in_array($cronsynchro,$crons)) { + $crons=[$cronsynchro]; + + } + foreach($crons as $cron) { $i++; + + // Id du cron + $idcron = $cron->getId(); // Flag d'execution en cours $now=new \DateTime(); @@ -94,6 +107,10 @@ class CronCommand extends ContainerAwareCommand // Executer la commande try{ $returnCode = $command->run($parameter, $output); + + // Revenir sur le cron encours à cause du clear du manager présent dans la synchro + // Sinon le manager se pomme et génère des nouveaux enregistrement plutot que mettre à jour celui en cours + $cron=$entityManager->getRepository('CadolesCronBundle:Cron')->find($idcron); } catch(\Exception $e) { $this->writelnred("JOB EN ERREUR"); diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php index 67930ee0..92bf6baf 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php @@ -42,6 +42,11 @@ class InitDataCommand extends ContainerAwareCommand } protected function insertCron() { + + $metadata = $this->entityManager->getClassMetaData('CadolesCronBundle:Cron'); + $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); + $metadata->setIdGenerator(new AssignedGenerator()); + // Job Mail // Toute les minutes $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1); @@ -58,10 +63,7 @@ class InitDataCommand extends ContainerAwareCommand $entity->setJsonargument('{"message-limit":"100","env":"prod"}'); $this->entityManager->persist($entity); } - // afin de forcer les ID sur certaines entités - $metadata = $this->entityManager->getClassMetaData(get_class($entity)); - $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); - $metadata->setIdGenerator(new AssignedGenerator()); + // Job synchronisation des comptes utilisateur // Toute les 24h à 3h00