diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php new file mode 100644 index 00000000..a191f802 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/ScriptCommand.php @@ -0,0 +1,84 @@ +setName('Core:Script') + ->setDescription('Lauch Script') + ->setHelp('Execeute some script : visibletrue / ') + ->addArgument('scriptname', InputArgument::OPTIONAL, 'scriptname') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->container = $this->getApplication()->getKernel()->getContainer(); + $this->em = $this->container->get('doctrine')->getEntityManager(); + $this->output = $output; + $this->filesystem = new Filesystem(); + $this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/"; + + $this->writelnred(''); + $this->writelnred('== Core:Script'); + $this->writelnred('=========================================================================================================='); + + $scriptname = $input->getArgument('scriptname'); + $this->writeln($scriptname); + + switch($scriptname) { + case "visibletrue": $this->visibletrue(); break; + } + + $this->writeln(''); + return 1; + } + + private function visibletrue() { + $users = $this->em->getRepository('CadolesCoreBundle:User')->findAll(); + foreach($users as $user) { + if(!$user->getVisible()) { + $this->writeln($user->getUsername()); + + $user->setVisible(true); + $this->em->persist($user); + $this->em->flush(); + } + } + } + + private function writelnred($string) { + $this->output->writeln(''.$string.''); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + } + private function writeln($string) { + $this->output->writeln($string); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + } + + + +} 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 a2830923..63bad02c 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}BkFFVAICIt3FUlHQLN1FsNWUtsPnLFRs +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}S0E51VgU0ZRXsD5jEdnUDeBkwBRO+29r ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/look.png b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/look.png index e0f7c73f..0b2ee113 100644 Binary files a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/look.png and b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/look.png differ diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/transnum-logo.png b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/transnum-logo.png index e0f7c73f..0b2ee113 100644 Binary files a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/transnum-logo.png and b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/transnum-logo.png differ