From 222676cf5bb83832114eb7af27559bc202a9780c Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 25 Jun 2019 15:53:10 +0200 Subject: [PATCH] svg --- src/ninegate-1.0/app/config/config.yml | 6 + .../CoreBundle/Command/SynchroCommand.php | 18 +- .../CoreBundle/Command/data/core-init-01.sql | 79 +++--- .../CoreBundle/Controller/UserController.php | 244 +++++++++++++++++- .../EventListener/sessionListener.php | 17 +- .../src/Cadoles/CoreBundle/Form/UserType.php | 1 + .../CoreBundle/Resources/config/routing.yml | 12 + .../views/Registration/resetpwd01.html.twig | 2 +- .../views/Registration/resetpwd02.html.twig | 2 +- .../Resources/views/User/import.html.twig | 72 ++++++ .../Resources/views/User/importfile.html.twig | 34 +++ .../CronBundle/Command/CronCommand.php | 27 +- .../CronBundle/Command/MailCommand.php | 14 +- tmpl/ninegate-init-01.sql | 77 +++--- 14 files changed, 503 insertions(+), 102 deletions(-) create mode 100644 src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/import.html.twig create mode 100755 src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/importfile.html.twig diff --git a/src/ninegate-1.0/app/config/config.yml b/src/ninegate-1.0/app/config/config.yml index 35993002..3fdd9260 100644 --- a/src/ninegate-1.0/app/config/config.yml +++ b/src/ninegate-1.0/app/config/config.yml @@ -65,6 +65,7 @@ swiftmailer: password: '%mailer_password%' auth_mode: '%mailer_authmode%' encryption: '%mailer_encryption%' + timeout: 5 stream-options: ssl: allow_self_signed : true @@ -97,6 +98,11 @@ oneup_uploader: frontend: dropzone # or any uploader you use in the frontend blogarticle: frontend: dropzone # or any uploader you use in the frontend + importuser: + frontend: dropzone # or any uploader you use in the frontend + namer: cadoles.core.upload.namer.same + storage: + directory: "%kernel.root_dir%/../uploads/importuser" file: frontend: dropzone # or any uploader you use in the frontend namer: cadoles.core.upload.namer.same 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 00077b95..68ea9125 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -27,6 +27,7 @@ class SynchroCommand extends Command private $output; private $filesystem; private $rootlog; + private $cptcommit; protected function configure() { @@ -146,6 +147,8 @@ class SynchroCommand extends Command } // On parcours les niveaux 01 pour connaitre les filtres ldap associé + $nbusers=0; + $this->cptcommit=0; $datas=$this->em->createQueryBuilder()->select('table')->from('CadolesCoreBundle:Niveau01','table')->where('table.ldapfilter IS NOT NULL')->getQuery()->getResult(); foreach($datas as $data) { // On execute le filtre d'appartenance à ce niveau @@ -153,6 +156,9 @@ class SynchroCommand extends Command // Pour chaque utilisateur ldap foreach($results as $result) { + // Compteur de users + $nbusers++; + // Formatage du résultat if(is_array($result[$ldap_username])) { $result[$ldap_username]=$result[$ldap_username][0]; @@ -202,9 +208,17 @@ class SynchroCommand extends Command } } } + + if(!$simulate&&$this->cptcommit>0&&($this->cptcommit%100==0)) { + $this->writelnred(" == COMMIT =="); + $this->em->flush(); + } } } - $this->em->flush(); + if(!$simulate) { + $this->writelnred(" == COMMIT =="); + $this->em->flush(); + } $this->writeln(''); $this->writeln('== USERS GROUP ======================================'); @@ -786,6 +800,7 @@ class SynchroCommand extends Command else $user->setRole("ROLE_USER"); + $this->cptcommit++; $this->em->persist($user); } @@ -797,6 +812,7 @@ class SynchroCommand extends Command if(in_array($username,$usersadmin)) $user->setRole("ROLE_ADMIN"); + $this->cptcommit++; $this->em->persist($user); } 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 d78759f3..77042b34 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,56 +8,57 @@ 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}6LUh9OzkGYupIHk89S/DJV+tXmVglWPE +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}EHcsvjQ0ZSD0/jiRa6+mC4AtCXMZesgA ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); TRUNCATE TABLE sidebar; INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES -(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''), -(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN,ROLE_MODO', ''), -(1020, 1000, 1020, 'Thème', 'cadoles_core_config_theme', 'fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''), -(1030, 1000, 1030, 'Modération', 'cadoles_core_config_permmodo', 'fa-balance-scale', 'ROLE_ADMIN', ''), +(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''), +(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN,ROLE_MODO', ''), +(1020, 1000, 1020, 'Thème', 'cadoles_core_config_theme', 'fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''), +(1030, 1000, 1030, 'Modération', 'cadoles_core_config_permmodo', 'fa-balance-scale', 'ROLE_ADMIN', ''), -(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', ''), +(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', ''), +(1270, 1200, 1270, 'Import Utilisateurs', 'cadoles_core_config_importuser', 'fa-download', 'ROLE_ADMIN,ROLE_MODO', 'importuser_activate'), -(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1510, 1500, 1510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1540, 1500, 1540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1550, 1500, 1550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1560, 1500, 1560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1570, 1500, 1570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1580, 1500, 1580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1510, 1500, 1510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1540, 1500, 1540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1550, 1500, 1550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1560, 1500, 1560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1570, 1500, 1570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1580, 1500, 1580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(2500, NULL, 2500, 'MODULES', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), -(2510, 2500, 2510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'page_activate'), -(2520, 2500, 2520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'item_activate'), -(2530, 2500, 2530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'alert_activate'), -(2540, 2500, 2540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'calendar_activate'), -(2550, 2500, 2550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'blog_activate'), -(2560, 2500, 2560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'flux_activate'), -(2570, 2500, 2570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'notice_activate'), -(2580, 2500, 2580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), +(2500, NULL, 2500, 'MODULES', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), +(2510, 2500, 2510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'page_activate'), +(2520, 2500, 2520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'item_activate'), +(2530, 2500, 2530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'alert_activate'), +(2540, 2500, 2540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'calendar_activate'), +(2550, 2500, 2550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'blog_activate'), +(2560, 2500, 2560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'flux_activate'), +(2570, 2500, 2570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'notice_activate'), +(2580, 2500, 2580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), -(3000, NULL, 3000, 'SYNCHRONISATION', NULL, 'fa-exchange', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), -(3001, 3000, 3001, 'Délégation', 'cadoles_portal_config_syncdelegation', 'fa-balance-scale', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), -(3120, 3000, 3120, 'Limesurvey', 'cadoles_portal_config_synclimesurvey', 'fa-question', 'ROLE_ADMIN,ROLE_MODO', 'activate_widlimesurvey'), -(3130, 3000, 3130, 'Moodle', 'cadoles_portal_config_syncmoodle', 'fa-graduation-cap', 'ROLE_ADMIN,ROLE_MODO', 'activate_widmoodle'), -(3160, 3000, 3160, 'Piwik', 'cadoles_portal_config_syncpiwik', 'fa-signal', 'ROLE_ADMIN,ROLE_MODO', 'activate_widpiwik'), -(3230, 3000, 3230, 'Wordpress', 'cadoles_portal_config_syncwordpress', 'fa-wordpress', 'ROLE_ADMIN,ROLE_MODO', 'activate_widwordpress'), +(3000, NULL, 3000, 'SYNCHRONISATION', NULL, 'fa-exchange', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), +(3001, 3000, 3001, 'Délégation', 'cadoles_portal_config_syncdelegation', 'fa-balance-scale', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), +(3120, 3000, 3120, 'Limesurvey', 'cadoles_portal_config_synclimesurvey', 'fa-question', 'ROLE_ADMIN,ROLE_MODO', 'activate_widlimesurvey'), +(3130, 3000, 3130, 'Moodle', 'cadoles_portal_config_syncmoodle', 'fa-graduation-cap', 'ROLE_ADMIN,ROLE_MODO', 'activate_widmoodle'), +(3160, 3000, 3160, 'Piwik', 'cadoles_portal_config_syncpiwik', 'fa-signal', 'ROLE_ADMIN,ROLE_MODO', 'activate_widpiwik'), +(3230, 3000, 3230, 'Wordpress', 'cadoles_portal_config_syncwordpress', 'fa-wordpress', 'ROLE_ADMIN,ROLE_MODO', 'activate_widwordpress'), -(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), -(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), -(7020, 7000, 7020, 'Logs', 'cadoles_cron_config_log', 'fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'); +(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7020, 7000, 7020, 'Logs', 'cadoles_cron_config_log', 'fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php index dc12f8ac..ede4a352 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php @@ -13,11 +13,16 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; - +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Cadoles\CoreBundle\Entity\User; use Cadoles\CoreBundle\Entity\UserGroup; use Cadoles\CoreBundle\Entity\UserModo; +use Cadoles\CoreBundle\Entity\Niveau01; +use Cadoles\CoreBundle\Entity\Niveau02; + use Cadoles\CoreBundle\Form\UserType; @@ -574,6 +579,224 @@ class UserController extends Controller return $this->updateAction($user->getId(),"user",$request); } + + + public function importuserAction(Request $request) { + if($this->GetParameter("masteridentity")!="SQL") + throw $this->createNotFoundException('Permission denied'); + + return $this->render('CadolesCoreBundle:User:import.html.twig',[ + 'useheader' => true, + 'usemenu' => false, + 'usesidebar' => true, + ]); + } + + public function importuserfileAction() + { + return $this->render('CadolesCoreBundle:User:importfile.html.twig',[ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + ]); + } + + public function importuserfilectrlAction(Request $request) + { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400); + + $em = $this->getDoctrine()->getManager(); + $output=array(); + $file = $request->request->get('file'); + + $csv = file_get_contents($this->get('kernel')->getRootDir()."/../".$file); + $tbfile = $this->csv_to_array($csv); + $error=""; + if(empty($tbfile)||!$tbfile[0]) + $error.="

Votre fichier CSV est mal formé, merci de le corriger

"; + else { + // On s'assure que les données minimums sont présentes en colonne + if(!array_key_exists("login",$tbfile[0])) $error.="

Colonne login manquante

"; + if(!array_key_exists("nom",$tbfile[0])) $error.="

Colonne nom manquante

"; + if(!array_key_exists("email",$tbfile[0])) $error.="

Colonne email manquante

"; + if(!array_key_exists("niveau01",$tbfile[0])) $error.="

Colonne niveau01 manquante

"; + + // On s'assure que toutes les colonnes sont des colonnes gérées par l'import + $tbkey=["login","prenom","nom","email","niveau01","niveau02","metier","fonction","nomusage","sexe","autreprenom","telephone","adresse","datenaissance","pays","ville","visible","role"]; + foreach($tbfile[0] as $key => $value) { + if(!in_array($key,$tbkey)) + $error.="

La colonne $key n'est pas une colonne gérée par l'import

"; + } + + // On vérifie les données + foreach($tbfile as $user) { + // On regarde si le login n'est pas déjà existant + $userbdd=$em->getRepository('CadolesCoreBundle:User')->findOneBy(["username"=>$user["login"]]); + if($userbdd) { + $error.="

Utilisateur = ".$user["login"]." existe déjà

"; + } + + if(strlen($user["login"])<5) $error.="

Utilisateur = ".$user["login"]." login trop court doit être >= 5

"; + + // On regarde si le email n'est pas déjà existant + $userbdd=$em->getRepository('CadolesCoreBundle:User')->findOneBy(["email"=>$user["email"]]); + if($userbdd) { + $error.="

Email = ".$user["email"]." existe déjà

"; + } + + // On regarde si le login / mail / nom n'est pas vide + if($user["login"]==""||$user["nom"]==""||$user["email"]=="") + $error.="

Valeur obligatoire pour login / nom / email

"; + + + // On regarde si le niveau01 existe + $niveau01=$em->getRepository('CadolesCoreBundle:Niveau01')->findOneBy(["label"=>$user["niveau01"]]); + if(!$niveau01) $error.="

Niveau 01 = ".$user["niveau01"]." inexistant

"; + + // On regarde si le niveau02 existe + if(array_key_exists("niveau02",$user)&&$user["niveau02"]!="") { + $niveau02=$em->getRepository('CadolesCoreBundle:Niveau02')->findOneBy(["label"=>$user["niveau02"],"niveau01"=>$niveau01]); + if(!$niveau02) $error.="

Niveau 02 = ".$user["niveau02"]." inexistant

"; + } + + // On regarde si le sexe est correctement formatté + if(array_key_exists("sexe",$user)&&$user["sexe"]!="") { + if($user["sexe"]!="male"&&$user["sexe"]!="female") + $error.="

Sexe ne peut prendre que la valeur vide / male / female

"; + } + + // On regarde si la date de naissance est correctement formatté + if(array_key_exists("datenaissance",$user)&&$user["datenaissance"]!="") { + try { + $date = \DateTime::createFromFormat('d/m/Y', $user["datenaissance"]); + if(!$date) $error.="

Date de naissance mal formattée

"; + } + catch (Exception $e) { + $error.="

Date de naissance mal formattée

"; + } + } + + // On regarde si la pays existe + if(array_key_exists("pays",$user)&&$user["pays"]!="") { + $country=$em->getRepository('CadolesCoreBundle:Country')->findOneBy(["label"=>$user["pays"]]); + if(!$country) $error.="

Pays = ".$user["pays"]." inexistant

"; + } + + // On regarde si la ville existe + if(array_key_exists("ville",$user)&&$user["ville"]!="") { + $city=$em->getRepository('CadolesCoreBundle:City')->findOneBy(["label"=>$user["ville"]]); + if(!$city) $error.="

Ville = ".$user["ville"]." inexistant

"; + } + + // On regarde si visible est correctement formatté + if(array_key_exists("visible",$user)&&$user["visible"]!="") { + if($user["visible"]!="oui"&&$user["sexe"]!="non") + $error.="

Visible ne peut prendre que la valeur vide / oui / non

"; + } + + // On regarde si visible est correctement formatté + if(array_key_exists("role",$user)&&$user["role"]!="") { + if($user["role"]!="ROLE_ADMIN"&&$user["role"]!="ROLE_MODO"&&$user["role"]!="ROLE_USER") + $error.="

Role ne peut prendre que la valeur vide / ROLE_ADMIN / ROLE_MODO / ROLE_USER

"; + } + } + } + + if($error!="") { + $output["status"]="KO"; + $output["error"]=$error; + } + else { + $output["status"] ="OK"; + $output["users"] =""; + + $appname = $this->get('session')->get('appname'); + $noreply = $this->getParameter('noreply'); + + // On importe + foreach($tbfile as $csvuser) { + $output["users"].="Création Utilisateur = ".$csvuser["login"]."
"; + + $user = new User(); + $username = $csvuser["login"]; + $password = Uuid::uuid4(); + $email = $csvuser["email"]; + $lastname = $csvuser["nom"]; + $firstname = (array_key_exists("prenom",$csvuser)?$csvuser["prenom"]:null); + $niveau01 = $em->getRepository('CadolesCoreBundle:Niveau01')->findOneBy(["label"=>$csvuser["niveau01"]]); + $niveau02 = (array_key_exists("niveau02",$csvuser)?$em->getRepository('CadolesCoreBundle:Niveau02')->findOneBy(["label"=>$csvuser["niveau02"]]):null); + $job = (array_key_exists("metier",$csvuser)?$csvuser["metier"]:null); + $position = (array_key_exists("fonction",$csvuser)?$csvuser["fonction"]:null); + $usalname = (array_key_exists("nomusage",$csvuser)?$csvuser["nomusage"]:null); + $gender = (array_key_exists("sexe",$csvuser)?$csvuser["sexe"]:null); + $givensname = (array_key_exists("autreprenom",$csvuser)?$csvuser["autreprenom"]:null); + $telephonenumber = (array_key_exists("telephone",$csvuser)?$csvuser["telephone"]:null); + $postaladress = (array_key_exists("adresse",$csvuser)?$csvuser["adresse"]:null); + $birthdate = (array_key_exists("datenaissance",$csvuser)&&$csvuser["datenaissance"]!=""?$csvuser["datenaissance"]:null); + $birthdate = (!is_null($birthdate)?\DateTime::createFromFormat('d/m/Y', $csvuser["datenaissance"]):null); + $birthcountry = (array_key_exists("pays",$csvuser)?$em->getRepository('CadolesCoreBundle:Country')->findOneBy(["label"=>$csvuser["pays"]]):null); + $birthplace = (array_key_exists("ville",$csvuser)?$em->getRepository('CadolesCoreBundle:City')->findOneBy(["label"=>$csvuser["ville"]]):null); + $visible = (array_key_exists("visible",$csvuser)&&$csvuser["visible"]!=""?($csvuser["visible"]=="oui"):true); + $role = (array_key_exists("role",$csvuser)&&$csvuser["role"]!=""?$csvuser["role"]:"ROLE_USER"); + + $user->setUsername($username); + $user->setPassword($password); + $user->setEmail($email); + $user->setLastname($lastname); + $user->setFirstname($firstname); + $user->setNiveau01($niveau01); + $user->setNiveau02($niveau02); + $user->setJob($job); + $user->setPosition($position); + $user->setUsualname($usalname); + $user->setGender($gender); + $user->setGivensname($givensname); + $user->setTelephonenumber($telephonenumber); + $user->setPostaladress($postaladress); + $user->setBirthdate($birthdate); + $user->setBirthcountry($birthcountry); + $user->setBirthplace($birthplace); + $user->setVisible($visible); + $user->setVisible(true); + $user->setRole($role); + + $user->setSiren($niveau01->getSiren()); + $user->setSiret((!is_null($niveau02)?$niveau02->getSiret():null)); + $user->setAuthlevel("simple"); + $user->setBelongingpopulation("agent"); + + $em->persist($user); + $em->flush(); + + // Email à destination de l'inscript pour le prévenir qu'il dispose d'un compte + $url = $this->generateUrl('cadoles_core_resetpwd01', [], UrlGeneratorInterface::ABSOLUTE_URL); + $text ="Vous venez d'être inscrit au portail = ".$appname."\n\n"; + $text.="Login = ".$username."\n"; + $text.="Password = Merci de suivre le lien suivant pour définir votre password\n\n"; + $texthtml=$text."$url"; + $text.=$url; + + $template="template"; + $mail_params=array( + "subject" => $appname." : Inscription automatique", + "body_html"=>nl2br($texthtml), + "body_text"=>$text + ); + + $to = $email; + $from = $noreply; + $fromName = $appname; + $message = $this->container->get('cadoles.core.service.mail'); + $message->sendEmail($template, $mail_params, $to, $from, $fromName); + } + } + + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + } + protected function getDatas() { $em = $this->getDoctrine()->getManager(); @@ -671,5 +894,22 @@ class UserController extends Controller $request->getSession()->getFlashBag()->add("error", $error->getMessage()); } } - } + } + + protected function csv_to_array($csv, $delimiter = ';', $enclosure = '', $escape = '\\', $terminator = "\n") { + $r = array(); + $rows = explode($terminator,trim($csv)); + + $names = array_shift($rows); + $names = str_getcsv($names,$delimiter,$enclosure,$escape); + $nc = count($names); + foreach ($rows as $row) { + if (trim($row)) { + $values = str_getcsv($row,$delimiter,$enclosure,$escape); + if (!$values) $values = array_fill(0,$nc,null); + @$r[] = array_combine($names,$values); + } + } + return $r; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php index bbbceeab..ef5226ab 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php @@ -67,8 +67,17 @@ if($curentuser=="anon.") $roles=[]; else $roles=$curentuser->getRoles(); + // Masteridentity + $masteridentity =$this->container->getParameter('masteridentity'); + $session->set('masteridentity',$masteridentity); + + // mode_auth + $mode_auth =$this->container->getParameter('mode_auth'); + $session->set('mode_auth',$mode_auth); + // App activate $app=[]; + $app["importuser_activate"] =($masteridentity=="SQL"); $app["portal_activate"] =$this->container->getParameter('portal_activate'); $app["cron_activate"] =$this->container->getParameter('cron_activate'); $app["module_activate"] =$this->container->getParameter('module_activate'); @@ -85,14 +94,6 @@ $app["activate_widpiwik"] =$this->container->getParameter('activate_widpiwik'); $app["activate_widwordpress"] =$this->container->getParameter('activate_widwordpress'); - // Masteridentity - $masteridentity =$this->container->getParameter('masteridentity'); - $session->set('masteridentity',$masteridentity); - - // mode_auth - $mode_auth =$this->container->getParameter('mode_auth'); - $session->set('mode_auth',$mode_auth); - // Chargement de la sidebar $iconniveau01 =$this->container->getParameter('iconniveau01'); $labelsniveau01 =$this->container->getParameter('labelsniveau01'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php index 4ae26e54..124c7dbf 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php @@ -47,6 +47,7 @@ class UserType extends AbstractType $builder->add('firstname', TextType::class, array( "label" =>"Prénom", + "required" => false, "disabled" => ($options["mode"]=="delete"||$options["masteridentity"]!="SQL"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") ) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml index f0a750cb..de232008 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml @@ -224,6 +224,18 @@ cadoles_core_config_user_ajax_list: path: /config/user/ajax/list defaults: { _controller: CadolesCoreBundle:User:ajaxlist, access: config } +cadoles_core_config_importuser: + path: /config/importuser + defaults: { _controller: CadolesCoreBundle:User:importuser } + +cadoles_core_config_importuser_file: + path: /config/importuserfile + defaults: { _controller: CadolesCoreBundle:User:importuserfile } + +cadoles_core_config_importuser_filectrl: + path: /config/importuserfilectrl + defaults: { _controller: CadolesCoreBundle:User:importuserfilectrl } + #-- Access user cadoles_core_profil: path: /user diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd01.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd01.html.twig index 2e82f493..b37a28ce 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd01.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd01.html.twig @@ -7,7 +7,7 @@ {{ form_start(form) }}

- Mot de passe oublié + Réinitialisation du mot de passe

{{ form_widget(form.submit) }} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd02.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd02.html.twig index 1fe93c52..02f82b50 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd02.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/resetpwd02.html.twig @@ -7,7 +7,7 @@ {{ form_start(form) }}

- Mot de passe oublié + Réinitialisation du mot de passe

{{ form_widget(form.submit) }} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/import.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/import.html.twig new file mode 100644 index 00000000..48c043f1 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/import.html.twig @@ -0,0 +1,72 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +

Import Utilisateurs

+ +
+
+ Importer votre fichier CSV +
+ +
+ + + Colonnes possibles
+ + login;prenom;nom;email;niveau01;niveau02;metier;fonction;nomusage;sexe;autreprenom;telephone;adresse;datenaissance;pays;ville;visible;role +

+ Colonne obligatoire = login / nom / email / niveau01

+ Sexe = vide / male / female
+ Visible = vide / oui / non
+ Rôle = vide / ROLE_USER / ROLE_MODO / ROLE_ADMIN

+ Niveau01 & Niveau02 & Pays & Ville = doivent exister dans la base

+ + Importation impossible si login et/ou email déjà existant en base
+ A chaque création un mail sera envoyé à l'utilisateur pour lui préceser qu'il est inscrit et qu'il devra suivre le process de reinitialisation de password pour ce connecter au portail. +
+
+ + EXECUTER L'IMPORT + +
+{% endblock %} + +{% block localjavascript %} + $(document).ready(function() { + $( "#exec" ).click(function() { + if($("#file_value").val()=="") + alert( "Vous devez importer un fichier CSV" ); + else { + $("#info").html(""); + $("#info").append("

Importation Utilisateur

"); + $("#info").append("

Contrôle Cohérance du Fichier

"); + + $.ajax({ + method: "POST", + url: "{{ path('cadoles_core_config_importuser_filectrl') }}", + data: { + file:$("#file_value").val(), + }, + success: function(data) { + console.log(data); + + if(data.status=="OK") { + $("#info").append("

Fichier correct

"); + + $("#info").append("

Importation

"); + $("#info").append("

"+data.users+"

"); + } + else { + $("#info").append("

Fichier incorrect

"); + $("#info").append("

Merci de corriger votre fichier

"); + $("#info").append("

"+data.error+"

"); + } + } + }); + } + }); + }); +{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/importfile.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/importfile.html.twig new file mode 100755 index 00000000..a00b2749 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/importfile.html.twig @@ -0,0 +1,34 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} + + Annuler + +
+
+{% endblock %} + + + +{% block localjavascript %} + Dropzone.options.MyDropZone = { + acceptedFiles: 'text/csv', + maxFiles: 1, + + success: function( file, response ){ + parent.$("#file_value").val("uploads/importuser/"+response["file"]); + closeModal(); + } + } + + function closeModal() { + window.parent.$("#mymodal").modal('hide'); + } + + $(window).load(function () { + // On vérifie que l'execution se fait bien dans le cadre d'une modal + if(!window.parent.$("#mymodal #framemodal").length) { + $(location).attr('href',"{{ path('cadoles_core_home') }}"); + } + }); +{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php index ef0984b2..2eddad8f 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php @@ -8,6 +8,8 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\LockableTrait; use Cadoles\CronBundle\Entity\Cron; @@ -16,6 +18,7 @@ class CronCommand extends ContainerAwareCommand private $output; private $filesystem; private $rootlog; + use LockableTrait; protected function configure() { @@ -40,8 +43,9 @@ class CronCommand extends ContainerAwareCommand return false; } - if($this->filesystem->exists($this->rootlog."cron.lock")) { - return false; + if (!$this->lock()) { + $this->output->writeln("CRON LOCK"); + return 0; } $this->filesystem->appendToFile($this->rootlog.'cron.lock', "lock"); @@ -90,7 +94,12 @@ class CronCommand extends ContainerAwareCommand $parameter = new ArrayInput($jsonparameter); // Executer la commande - $returnCode = $command->run($parameter, $output); + try{ + $returnCode = $command->run($parameter, $output); + } + catch(\Exception $e) { + $this->writelnred("JOB EN ERREUR"); + } // Flag de fin d'execution $now=new \DateTime(); @@ -121,12 +130,12 @@ class CronCommand extends ContainerAwareCommand $entityManager->flush(); } - $this->writelnred("=="); - $this->writelnred("FIN CRON"); - $this->writelnred("=="); - $this->writelnred(""); - - $this->filesystem->remove($this->rootlog."cron.lock"); + if($crons) { + $this->writelnred("=="); + $this->writelnred("FIN CRON"); + $this->writelnred("=="); + $this->writelnred(""); + } } private function writelnred($string) { diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/MailCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/MailCommand.php index 86a8a118..37414b61 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/MailCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/MailCommand.php @@ -44,14 +44,22 @@ class MailCommand extends Command $this->writelnred(''); $this->writelnred('== Cron:Mail'); $this->writelnred('=========================================================================================================='); - + $command = $this->getApplication()->find("swiftmailer:spool:send"); $tbparameter["--message-limit"]=100; $tbparameter["--env"]="prod"; $parameter = new ArrayInput($tbparameter); - $returnCode = $command->run($parameter, $output); + try{ + $returnCode = $command->run($parameter, $output); + } + catch(\Exception $e) { + $this->writeln(""); + $this->writelnred("Impossible d'envoyer des mails"); + $this->writeln(""); + return 0; + } $this->writeln(""); - + return 1; } diff --git a/tmpl/ninegate-init-01.sql b/tmpl/ninegate-init-01.sql index a93b55dd..deefecca 100644 --- a/tmpl/ninegate-init-01.sql +++ b/tmpl/ninegate-init-01.sql @@ -24,51 +24,52 @@ INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastna TRUNCATE TABLE sidebar; INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES -(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''), -(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN,ROLE_MODO', ''), -(1020, 1000, 1020, 'Thème', 'cadoles_core_config_theme', 'fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''), -(1030, 1000, 1030, 'Modération', 'cadoles_core_config_permmodo', 'fa-balance-scale', 'ROLE_ADMIN', ''), +(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''), +(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN,ROLE_MODO', ''), +(1020, 1000, 1020, 'Thème', 'cadoles_core_config_theme', 'fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''), +(1030, 1000, 1030, 'Modération', 'cadoles_core_config_permmodo', 'fa-balance-scale', 'ROLE_ADMIN', ''), -(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', ''), +(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', ''), %if %%getVar("ninegate_niveau02view", 'non') == "oui" -(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), +(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), %end if -(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', ''), +(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', ''), +(1270, 1200, 1270, 'Import Utilisateurs', 'cadoles_core_config_importuser', 'fa-download', 'ROLE_ADMIN,ROLE_MODO', 'importuser_activate'), -(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1510, 1500, 1510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1540, 1500, 1540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1550, 1500, 1550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1560, 1500, 1560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1570, 1500, 1570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(1580, 1500, 1580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1510, 1500, 1510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1540, 1500, 1540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1550, 1500, 1550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1560, 1500, 1560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1570, 1500, 1570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), +(1580, 1500, 1580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'), -(2500, NULL, 2500, 'MODULES', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), -(2510, 2500, 2510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'page_activate'), -(2520, 2500, 2520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'item_activate'), -(2530, 2500, 2530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'alert_activate'), -(2540, 2500, 2540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'calendar_activate'), -(2550, 2500, 2550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'blog_activate'), -(2560, 2500, 2560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'flux_activate'), -(2570, 2500, 2570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'notice_activate'), -(2580, 2500, 2580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), +(2500, NULL, 2500, 'MODULES', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), +(2510, 2500, 2510, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'page_activate'), +(2520, 2500, 2520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'item_activate'), +(2530, 2500, 2530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'alert_activate'), +(2540, 2500, 2540, 'Calendriers', 'cadoles_portal_config_calendar', 'fa-calendar', 'ROLE_ADMIN,ROLE_MODO', 'calendar_activate'), +(2550, 2500, 2550, 'Blogs', 'cadoles_portal_config_blog', 'fa-paper-plane', 'ROLE_ADMIN,ROLE_MODO', 'blog_activate'), +(2560, 2500, 2560, 'Flux', 'cadoles_portal_config_flux', 'fa-rss', 'ROLE_ADMIN,ROLE_MODO', 'flux_activate'), +(2570, 2500, 2570, 'Chartes', 'cadoles_portal_config_notice', 'fa-info', 'ROLE_ADMIN,ROLE_MODO', 'notice_activate'), +(2580, 2500, 2580, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'module_activate'), -(3000, NULL, 3000, 'SYNCHRONISATION', NULL, 'fa-exchange', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), -(3001, 3000, 3001, 'Délégation', 'cadoles_portal_config_syncdelegation', 'fa-balance-scale', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), -(3120, 3000, 3120, 'Limesurvey', 'cadoles_portal_config_synclimesurvey', 'fa-question', 'ROLE_ADMIN,ROLE_MODO', 'activate_widlimesurvey'), -(3130, 3000, 3130, 'Moodle', 'cadoles_portal_config_syncmoodle', 'fa-graduation-cap', 'ROLE_ADMIN,ROLE_MODO', 'activate_widmoodle'), -(3160, 3000, 3160, 'Piwik', 'cadoles_portal_config_syncpiwik', 'fa-signal', 'ROLE_ADMIN,ROLE_MODO', 'activate_widpiwik'), -(3230, 3000, 3230, 'Wordpress', 'cadoles_portal_config_syncwordpress', 'fa-wordpress', 'ROLE_ADMIN,ROLE_MODO', 'activate_widwordpress'), +(3000, NULL, 3000, 'SYNCHRONISATION', NULL, 'fa-exchange', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), +(3001, 3000, 3001, 'Délégation', 'cadoles_portal_config_syncdelegation', 'fa-balance-scale', 'ROLE_ADMIN,ROLE_MODO', 'syncenvole_activate'), +(3120, 3000, 3120, 'Limesurvey', 'cadoles_portal_config_synclimesurvey', 'fa-question', 'ROLE_ADMIN,ROLE_MODO', 'activate_widlimesurvey'), +(3130, 3000, 3130, 'Moodle', 'cadoles_portal_config_syncmoodle', 'fa-graduation-cap', 'ROLE_ADMIN,ROLE_MODO', 'activate_widmoodle'), +(3160, 3000, 3160, 'Piwik', 'cadoles_portal_config_syncpiwik', 'fa-signal', 'ROLE_ADMIN,ROLE_MODO', 'activate_widpiwik'), +(3230, 3000, 3230, 'Wordpress', 'cadoles_portal_config_syncwordpress', 'fa-wordpress', 'ROLE_ADMIN,ROLE_MODO', 'activate_widwordpress'), -(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), -(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), -(7020, 7000, 7020, 'Logs', 'cadoles_cron_config_log', 'fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'); +(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7020, 7000, 7020, 'Logs', 'cadoles_cron_config_log', 'fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate');