From 177f366a83c87ad8f00fa3646bfd0c2b91ede56d Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 15 Jul 2020 14:07:39 +0200 Subject: [PATCH 1/8] pb sur modification du mail sur synchronisation ldap (ref #182) --- .../src/Cadoles/CoreBundle/Command/SynchroCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7d131a8b..9d742b21 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -243,7 +243,8 @@ class SynchroCommand extends Command if($user->getLastname()!=$result[$ldap_lastname]||$user->getFirstname()!=$result[$ldap_firstname]||$user->getEmail()!=$result[$ldap_email]||$toadmin) { $usermail=$this->em->getRepository('CadolesCoreBundle:User')->findOneBy(array('email' => $result[$ldap_email])); - if($usermail!=$user) { + + if($usermail&&$usermail!=$user) { array_push($tberrors," - Modification dans Bundle impossible >> ".$result[$ldap_username]." un autre utilisateur a déjà ce mail = ".$result[$ldap_email]); } else { From fb879143d57c561fd1d5598a4c5d070d85eb2d67 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 15 Jul 2020 14:38:16 +0200 Subject: [PATCH 2/8] parametrer la synchro scribe (ref #183) --- dicos/91_ninegate.xml | 15 +++++++++++++++ .../CoreBundle/Command/SynchroCommand.php | 17 ++++++++++------- tmpl/ninegate-template.yml | 14 ++++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) 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 From 2c1078d19ee1047c76417cc424289ffe9a32c490 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 15 Jul 2020 15:08:42 +0200 Subject: [PATCH 3/8] purge des groupes inexistant dans l'annuaire --- .../CoreBundle/Command/SynchroCommand.php | 56 +++++++++++++++++++ .../CoreBundle/Controller/GroupController.php | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) 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 dc5dcb16..e3174898 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/SynchroCommand.php @@ -379,6 +379,62 @@ class SynchroCommand extends Command $this->em->clear(); if($nbusers%1000==0) $this->writelnred(" == Nombre d'utilisateurs traités = $nbusers=="); } + + $this->writeln(''); + $this->writeln('== GROUPS ============================================'); + // Pour chaque groupe annuaire on s'assure que le groupe existe bien dans l'annuaire + $groups=$this->em->getRepository('CadolesCoreBundle:Group')->findBy(["fgtemplate"=>true]); + foreach($groups as $group) { + if(stripos($group->getLabel(),"PROFIL - ")===false) { + $results = $this->ldap->search($group->getLdapfilter(), [], $this->ldap_basedn); + if(count($results)==0) { + $this->writeln(" - Suppression dans Bundle >> ".$group->getLabel()); + if(!$simulate) { + if($group->getFgcanshare()) { + // Sur l'ensemble des pages liés + $pages=$group->getPages(); + foreach($pages as $page) { + $getgroups=$page->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($page); + } + + // Sur l'ensemble des calendar liés + $calendars=$group->getCalendars(); + foreach($calendars as $calendar) { + $getgroups=$calendar->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($calendar); + } + + // Sur l'ensemble des blog liés + $blogs=$group->getBlogs(); + foreach($blogs as $blog) { + $getgroups=$blog->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($blog); + } + + // Sur l'ensemble des project liés + $projects=$group->getProjects(); + foreach($projects as $project) { + $getgroups=$project->getGroups(); + // si la page est lié qu'à un seul group on peut la supprimer + if($getgroups->count()==1) + $this->em->remove($project); + } + } + + $this->em->remove($group); + $this->em->flush(); + } + } + } + } + } } else { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index a47e47a7..a20ed7e0 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -958,7 +958,7 @@ class GroupController extends Controller // Sur l'ensemble des project liés $projects=$data->getProjects(); foreach($projects as $project) { - $groups=$blog->getGroups(); + $groups=$project->getGroups(); // si la page est lié qu'à un seul group on peut la supprimer if($groups->count()==1) $em->remove($project); From 514fe6b82c65d14bdc60b07e7cc7b3e678c4f4de Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 15 Jul 2020 15:15:38 +0200 Subject: [PATCH 4/8] orthographe connection en connexion (ref #186) --- .../Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig | 2 +- .../CoreBundle/Resources/views/Registration/edit.html.twig | 2 +- .../src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig | 2 +- tmpl/ninegate-init-01.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig index 35e3b377..41c5877f 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Core/reconnect.html.twig @@ -41,7 +41,7 @@

{{ app.session.get('appname') }}

-

Vous avez perdu votre connection

+

Vous avez perdu votre connexion

ou

Vous n'avez plus accès à cette page



diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig index 5526446b..d131a30f 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig @@ -59,7 +59,7 @@
- Connection + Connexion
diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig index 462dfe89..43885036 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig @@ -66,7 +66,7 @@
- Connection + Connexion
diff --git a/tmpl/ninegate-init-01.sql b/tmpl/ninegate-init-01.sql index 5907fa28..b39d9bd9 100644 --- a/tmpl/ninegate-init-01.sql +++ b/tmpl/ninegate-init-01.sql @@ -97,7 +97,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('006', 0, 1, 0, 'datauser', 'datauser', '', '', 'Parametrage des champs utilisateurs : obligatoire / facultatif / caché'), ('007', 0, 1, 0, 'datausers', 'datausers', '', '', 'Parametrage des colonnes visible dans la liste des utilisateurs'), -('010', 1, 1, 1, 'boolean', 'fgforceconnect', '0', '', 'Forcer la connection afin de rendre votre site privé'), +('010', 1, 1, 1, 'boolean', 'fgforceconnect', '0', '', 'Forcer la connexion afin de rendre votre site privé'), ('040', 1, 1, 1, 'boolean', 'fgheader', '1', '', 'Utiliser une image en bannière du site'), ('041', 1, 1, 1, 'header', 'header', 'uploads/header/header.png', 'fgheader', 'Image en bannière du site'), From c4815ac935b9ba0ad794fe2e60f50666388ff20d Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 15 Jul 2020 15:25:24 +0200 Subject: [PATCH 5/8] =?UTF-8?q?orthographe=20ic=C3=B4ne=20(ref=20#187)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreBundle/Resources/public/themes/transnum/local.js | 6 +++--- .../Cadoles/CoreBundle/Resources/views/Group/edit.html.twig | 4 ++-- .../Cadoles/CoreBundle/Resources/views/Group/list.html.twig | 2 +- .../src/Cadoles/PortalBundle/Command/InitDataCommand.php | 2 +- src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php | 2 +- .../Resources/views/Alertcategory/edit.html.twig | 4 ++-- .../PortalBundle/Resources/views/Bookmark/edit.html.twig | 4 ++-- .../PortalBundle/Resources/views/Item/edit.html.twig | 4 ++-- .../PortalBundle/Resources/views/Pagewidget/edit.html.twig | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js index 1e0a076d..0280f746 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/themes/transnum/local.js @@ -255,7 +255,7 @@ function MyTourGroupe() { element: $("#diviconsel"), title: "Icône du groupe", placement : "right", - content: "Choisissez l'icône pour votre groupe en cliquant sur 'Sélectionner un icône'.", + content: "Choisissez l'icône pour votre groupe en cliquant sur 'Sélectionner une icône'.", }, { element: $("#group_submit"), @@ -793,7 +793,7 @@ function AdminGroupSubmit() { element: $("#diviconsel"), title: "Icône du groupe", placement : "top", - content: "Choisissez l'icône pour le groupe en cliquant sur 'Sélectionner un icône'. ", + content: "Choisissez l'icône pour le groupe en cliquant sur 'Sélectionner une icône'. ", }, { element: $("#group_fgcancreatepage"), @@ -1876,7 +1876,7 @@ function AdminIcon() { steps: [ { element: $(".btn:first"), - title: "Ajouter une icone", + title: "Ajouter une icône", placement : "top", content: "Ajoutez une icône en cliquant sur ce bouton - les icônes sont utilisées pour l'identité des items, des widgets et des groupes. En cliquant sur une icône existante, vous pourrez la supprimer ou la modifier. Essayez de choisir des icônes en phase avec les tendances graphiques du portail... ", }, diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig index 13f492b6..6666532f 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/edit.html.twig @@ -121,7 +121,7 @@
@@ -219,7 +219,7 @@ } function selectIcon() { - $("#mymodal").find(".modal-title").html("SELECTIONNER UN ICONE"); + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); var url="{{ path('cadoles_portal_user_icon_select') }}"; $("#mymodal").find("#framemodal").attr("src",url); $("#mymodal").modal("show"); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig index 1b7b1f8d..597d3bd7 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig @@ -32,7 +32,7 @@ Action - Icone + Icône Label Ouvert Filtre diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php index 6051a8c4..b0f1d0d8 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -1328,7 +1328,7 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setOpened(true); $entityWidget->setAccess(["config","user","group"]); $entityWidget->setColorbodyback("ffffff"); - $parameter = json_decode('{"fields": [{"id": "seetitle", "loc": "col1", "type": "boolean", "label": "Afficher le titre", "value": "0", "mandatory": "true"},{"id": "seeicon", "loc": "col1", "type": "boolean", "label": "Afficher l\'icone", "value": "0", "mandatory": "true"}]}'); + $parameter = json_decode('{"fields": [{"id": "seetitle", "loc": "col1", "type": "boolean", "label": "Afficher le titre", "value": "0", "mandatory": "true"},{"id": "seeicon", "loc": "col1", "type": "boolean", "label": "Afficher l\'icône", "value": "0", "mandatory": "true"}]}'); $entityWidget->setParameter($parameter); $em->persist($entityWidget); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php index 64d8151e..a7a75e53 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Icon.php @@ -11,7 +11,7 @@ use Symfony\Component\Validator\Constraints as Assert; * @ORM\Entity * @ORM\Table(name="icon") * @ORM\HasLifecycleCallbacks - * @UniqueEntity(fields="label", message="Un Icone existe déjà avec ce label") + * @UniqueEntity(fields="label", message="Une Icône existe déjà avec ce label") */ class Icon { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig index f74b8bf1..2a2f0045 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig @@ -57,7 +57,7 @@
@@ -68,7 +68,7 @@