diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/uploadListener.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/uploadListener.php
index 33d89303..93a89dc3 100644
--- a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/uploadListener.php
+++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/uploadListener.php
@@ -138,8 +138,11 @@ class uploadListener
if($fgexit) $message="Modification fichier
".$filename;
else $message="Création fichier
".$filename;
- $key=$this->em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->token->getToken()->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->token->getToken()->getUser()->getId(),$group->getId(),$message);
+ $usergroup=$this->em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->token->getToken()->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->token->getToken()->getUser()->getId(),$group->getId(),$message);
+ }
}
}
}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php
index 7d87cd82..abc36c7d 100644
--- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php
+++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BlogarticleController.php
@@ -59,8 +59,11 @@ class BlogarticleController extends Controller
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]);
$message="Création article
".$entity->getName()."";
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ }
}
}
@@ -104,8 +107,11 @@ class BlogarticleController extends Controller
if($group->getFgcanshare()) {
$url=$this->generateUrl('cadoles_portal_'.$access.'_blogarticle_view',["id"=>$entity->getId()]);
$message="Modification article
".$entity->getName()."";
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ }
}
}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BookmarkController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BookmarkController.php
index 8e1cc10c..61d21a85 100644
--- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BookmarkController.php
+++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/BookmarkController.php
@@ -67,8 +67,11 @@ class BookmarkController extends Controller
foreach($pagewidget->getPage()->getGroups() as $groupchat) {
if($groupchat->getFgcanshare()) {
$message="Création favoris
".$data->getTitle()."";
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
+ }
}
}
}
@@ -155,8 +158,11 @@ class BookmarkController extends Controller
foreach($pagewidget->getPage()->getGroups() as $groupchat) {
if($groupchat->getFgcanshare()) {
$message="Modification favoris
".$data->getTitle()."";
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groupchat,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groupchat->getId(),$message);
+ }
}
}
}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendareventController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendareventController.php
index 3476870e..fea73611 100644
--- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendareventController.php
+++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/CalendareventController.php
@@ -128,8 +128,11 @@ class CalendareventController extends Controller
foreach($calendarevent->getCalendar()->getGroups() as $group) {
if($group->getFgcanshare()) {
$message="Création évènement
".$calendarevent->getName()."
du ".$start->format("d/m/Y H:i")." au ".$end->sub(new \DateInterval('PT1M'))->format("d/m/Y H:i");
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ }
}
}
@@ -181,8 +184,11 @@ class CalendareventController extends Controller
foreach($calendarevent->getCalendar()->getGroups() as $group) {
if($group->getFgcanshare()) {
$message="Modification évènement
".$calendarevent->getName()."
du ".$start->format("d/m/Y H:i")." au ".$end->sub(new \DateInterval('PT1M'))->format("d/m/Y H:i");
- $key=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()])->getKeyvalue();
- $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
+ if($usergroup) {
+ $key=$usergroup->getKeyvalue();
+ $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$group->getId(),$message);
+ }
}
}