diff --git a/dicos/91_ninegate.xml b/dicos/91_ninegate.xml index 000fb384..8dc5c927 100644 --- a/dicos/91_ninegate.xml +++ b/dicos/91_ninegate.xml @@ -74,6 +74,8 @@ non scribe + oui + oui cadoles cadoles @@ -398,6 +400,8 @@ ninegate_syncldap ninegate_ldaptemplate + ninegate_scribegroup + ninegate_scribemaster ninegate_pwdadmin ninegate_organization @@ -517,6 +521,17 @@ + + + + scribe + + ninegate_scribegroup + ninegate_scribemaster + + + + non 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 9d742b21..dc5dcb16 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -101,6 +101,8 @@ class SynchroCommand extends Command $ldap_lastname = $this->container->getParameter('ldap_lastname'); $ldap_email = $this->container->getParameter('ldap_email'); $ldap_usersadmin = $this->container->getParameter('ldap_usersadmin'); + $scribe_group = $this->container->getParameter('scribe_group'); + $scribe_master = $this->container->getParameter('scribe_master'); $fieldstoread = array($ldap_username,$ldap_firstname,$ldap_lastname,$ldap_email); $ldapusers = array(); $ldapmails = array(); @@ -119,7 +121,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,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); // Responsables $ldapfilter="(&(uid=*)(ENTPersonProfils=responsable))"; @@ -131,7 +133,7 @@ class SynchroCommand extends Command $ldapfilter="(&(uid=*)(ENTPersonProfils=administratif))"; $label="PROFIL - Administratifs"; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); // Classes $this->writeln(''); @@ -143,7 +145,7 @@ class SynchroCommand extends Command $label="CLASSE - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } // Options @@ -156,7 +158,7 @@ class SynchroCommand extends Command $label="OPTION - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } // Groupes @@ -169,7 +171,7 @@ class SynchroCommand extends Command $label="GROUPE - ".$result["cn"]; $this->writeln(" - $label"); - if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); + if(!$simulate) $this->addmodGroup($label,$ldapfilter,$scribe_group); } } @@ -701,13 +703,13 @@ class SynchroCommand extends Command $group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => true, 'label' => $label)); if(!$group) { $group=new Group(); - $group->setFgcanshare($fgcanshare); $group->setFgcancreatepage(false); $group->setFgcancreateblog(false); $group->setFgcancreatecalendar(false); $group->setFgcancreateproject(false); } + $group->setFgcanshare($fgcanshare); $group->setLabel($label); $group->setFgopen(false); $group->setFgall(false); @@ -783,7 +785,8 @@ class SynchroCommand extends Command // Si modèle scribe $ldap_template = $this->container->getParameter('ldap_template'); - if($ldap_template=="scribe") { + $scribe_master = $this->container->getParameter('scribe_master'); + if($ldap_template=="scribe"&&$scribe_master) { $ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))"; $results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn); if($results) $member->setFgmanager(true); diff --git a/tmpl/ninegate-template.yml b/tmpl/ninegate-template.yml index 4ddb4adb..666cc354 100644 --- a/tmpl/ninegate-template.yml +++ b/tmpl/ninegate-template.yml @@ -184,6 +184,20 @@ parameters: ldap_email: mail ldap_usersadmin: [admin] + # Template scribe +%if %%getVar("ninegate_scribegroup", 'non') == "oui" + scribe_group: true +%else + scribe_group: false +%end if + +%if %%getVar("ninegate_scribemaster", 'non') == "oui" + scribe_master: true +%else + scribe_master: false +%end if + + # Activation Widget %if %%getVar("ninegate_activate_widadminer", 'non') == "oui" activate_widadminer: true