diff --git a/dicos/91_ninegate.xml b/dicos/91_ninegate.xml index 13046828..0491d3f6 100644 --- a/dicos/91_ninegate.xml +++ b/dicos/91_ninegate.xml @@ -80,37 +80,41 @@ oui - LDAP - CAS - APIKeyNinegate + LDAP + CAS + APIKeyNinegate non - scribe + scribe oui - oui + oui + (uid=*) + oui + (objectClass=posixGroup) - - - niveau01 - niveau02 - - - Ecole - Ecoles - fa-building + + + niveau01 + niveau02 + + + + Ecole + Ecoles + fa-building non - Service - Services - fa-sitemap + Service + Services + fa-sitemap - 2c3e50 - FFFFFF + 2c3e50 + FFFFFF - none - 8 - 8 + none + 8 + 8 @@ -170,208 +174,208 @@ non - + non - - + + non - + non - + non - + non - + non - + non - + non - + non - + non - - + + non - + non - + non - + non - - - - + + + + non - + non - - - + + + non - - + + non - + non - + non - - + + non - + non - + non - - + + non - + non - - + + non - - + + - - + + 5555 - + 5556 - + oui - - - - - - + + + + + + - - - - - - + + + + + + @@ -428,6 +432,9 @@ ninegate_ldaptemplate ninegate_scribegroup ninegate_scribemaster + ninegate_openldapreqniveau01 + ninegate_openldapsynchrogroup + ninegate_openldapreqgroup ninegate_pwdadmin ninegate_organization @@ -604,8 +611,22 @@ ninegate_scribemaster - - + + + open + + ninegate_openldapreqniveau01 + ninegate_openldapsynchrogroup + ninegate_openldapreqgroup + + + + + non + + ninegate_openldapreqgroup + + non 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 ec4956a0..ad1a08ff 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php @@ -144,7 +144,7 @@ class InitDataCommand extends ContainerAwareCommand if($ldap_template=="scribe") $niveau01->setLdapfilter("(&(uid=*)(objectclass=inetOrgPerson)(!(description=Computer)))"); else - $niveau01->setLdapfilter("(uid=*)"); + $niveau01->setLdapfilter($this->getContainer()->getParameter('openldapreqniveau01')); $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 f893ca10..c2dc6d8f 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -174,6 +174,22 @@ class SynchroCommand extends Command if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } } + elseif($ldap_template=="open") { + if($this->container->getParameter('openldapsynchrogroup')) { + $this->writeln(''); + $this->writeln('== GROUPES =========================================='); + + $results = $this->ldap->search($this->container->getParameter('openldapreqgroup'), ['cn','description','gidNumber'], $this->ldap_basedn); + foreach($results as $result) { + $cn=$result["cn"]; + $ldapfilter="(&".$this->container->getParameter('openldapreqgroup')."(cn=$cn))"; + + $label=$result["cn"]; + $this->writeln(" - $label"); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,false); + } + } + } $this->writeln(''); $this->writeln('== USERS ============================================'); @@ -760,6 +776,12 @@ class SynchroCommand extends Command protected function addmodGroup($label,$ldapfilter,$fgcanshare) { $portal_activate = $this->container->getParameter('portal_activate'); + $group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => false, 'label' => $label)); + if($group) { + $this->writelnred(" - ".$label." existe déjà comme groupe interne à Ninegate"); + return 0; + } + $group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => true, 'label' => $label)); if(!$group) { $group=new Group(); diff --git a/tmpl/ninegate-template.yml b/tmpl/ninegate-template.yml index 4efb13fa..5d7348b0 100644 --- a/tmpl/ninegate-template.yml +++ b/tmpl/ninegate-template.yml @@ -203,6 +203,23 @@ parameters: scribe_master: false %end if +%if %%getVar("ninegate_ldaptemplate", 'non') == "open" + openldapreqniveau01: %%ninegate_openldapreqniveau01 + + %if %%getVar("ninegate_openldapsynchrogroup", 'non') == "oui" + openldapsynchrogroup: true + openldapreqgroup: %%ninegate_openldapreqgroup + %else + openldapsynchrogroup: false + openldapreqgroup: + %end if +%else + openldapreqniveau01: + openldapsynchrogroup: false + openldapreqgroup: +%end if + + # Activation Widget %if %%getVar("ninegate_activate_widadminer", 'non') == "oui"