From 025009e76c409c6d8f02d29f7feaf089309f6a49 Mon Sep 17 00:00:00 2001 From: afornerot Date: Mon, 6 Jul 2020 11:59:17 +0200 Subject: [PATCH] tout les groups sur rest user --- .../CoreBundle/Controller/RestController.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php index d60b7bea..fc32c542 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php @@ -130,14 +130,12 @@ class RestController extends Controller } } - if($groupsshared) { - foreach($groupsshared as $groupshared) { - $tmp=[]; - $tmp["id"] = $groupshared->getId(); - $tmp["title"] = $groupshared->getLabel(); - - array_push($output["groups"],$tmp); - } + foreach($user->getGroups() as $usergroup) { + $tmp=[]; + $tmp["id"] = $usergroup->getGroup()->getId(); + $tmp["title"] = $usergroup->getGroup()->getLabel(); + + array_push($output["groups"],$tmp); } // Retour