Compare commits
No commits in common. "30a89a23b80023a9b9302f466ec6e45d5b983e1d" and "0afd32a4e6384d76207c19a647c19263fff53a6e" have entirely different histories.
30a89a23b8
...
0afd32a4e6
@ -45,7 +45,7 @@ class ScribeToNinegateCommand extends Command
|
||||
$this->host = $input->getArgument('host');
|
||||
$this->port = 389;
|
||||
$this->pwd = $input->getArgument('pwd');
|
||||
$this->user = "cn=reader,o=gouv,c=fr";
|
||||
$this->user = "cn=admin,o=gouv,c=fr";
|
||||
|
||||
$ldap_basedn = $this->container->getParameter('ldap_basedn');
|
||||
$ldap_username = $this->container->getParameter('ldap_username');
|
||||
@ -105,6 +105,9 @@ class ScribeToNinegateCommand extends Command
|
||||
$this->writelnred('PURGE DES BLOG');
|
||||
$this->purge('CadolesPortalBundle:Blog');
|
||||
|
||||
$this->writelnred('PURGE DES PAGES');
|
||||
$this->purge('CadolesPortalBundle:Page');
|
||||
|
||||
$this->writelnred('PURGE DES PROJECT');
|
||||
$this->purge('CadolesPortalBundle:Project');
|
||||
|
||||
@ -123,14 +126,13 @@ class ScribeToNinegateCommand extends Command
|
||||
$this->writelnred('PURGE DES NIVEAU 01');
|
||||
$this->purge('CadolesCoreBundle:Niveau01');
|
||||
|
||||
$this->writelnred('PURGE DES PAGES');
|
||||
$this->purge('CadolesPortalBundle:Page');
|
||||
|
||||
$this->writelnred('PURGE DES ICONES');
|
||||
$this->purge('CadolesPortalBundle:Icon');
|
||||
|
||||
|
||||
$this->writeln('');
|
||||
|
||||
|
||||
$this->writelnred('');
|
||||
$this->writelnred('== INIT DATA');
|
||||
$command = $this->getApplication()->find("Core:InitData");
|
||||
@ -251,20 +253,6 @@ class ScribeToNinegateCommand extends Command
|
||||
}
|
||||
|
||||
private function purge($entityname) {
|
||||
// Si on purge les pages il faut d'abord purger les pages qui ne sont pas pagetemplate
|
||||
if($entityname=="CadolesPortalBundle:Page") {
|
||||
$qb=$this->em->createQueryBuilder();
|
||||
$entitys = $qb->select('t')
|
||||
->from($entityname,'t')
|
||||
->where($qb->expr()->isNotNull('t.page'))
|
||||
->getQuery()
|
||||
->getResult();
|
||||
foreach ($entitys as $entity) {
|
||||
$this->em->remove($entity);
|
||||
}
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$entitys=$this->em->getRepository($entityname)->findAll();
|
||||
foreach ($entitys as $entity) {
|
||||
$this->em->remove($entity);
|
||||
|
@ -45,12 +45,7 @@ class ldapService
|
||||
}
|
||||
|
||||
public function connect() {
|
||||
// Si on est déjà co = on rebind pour gérer le cas d'un timeout de connection
|
||||
if($this->connection){
|
||||
if(!ldap_bind($this->connection, $this->user, $this->password)){
|
||||
$this->disconnect();
|
||||
}
|
||||
}
|
||||
$this->disconnect();
|
||||
|
||||
if($this->connection){
|
||||
return $this->connection;
|
||||
|
Loading…
x
Reference in New Issue
Block a user