svg modele scribe
This commit is contained in:
parent
e9b2f694fa
commit
abd323163e
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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('');
|
||||
|
|
|
@ -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', ''),
|
||||
|
|
|
@ -63,9 +63,22 @@ 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();
|
||||
$cron->setStartexecdate($now);
|
||||
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue