pb sur propriétaire de groupe
This commit is contained in:
parent
c702a4b0d2
commit
1eacaeea9a
|
@ -703,6 +703,7 @@ class GroupController extends Controller
|
|||
$data->setFgtemplate(false);
|
||||
if($data->getLdapfilter()!="") $data->setFgopen(false);
|
||||
if($data->getAttributes()!="") $data->setFgopen(false);
|
||||
if($access=="user") $data->setOwner($this->getUser());
|
||||
|
||||
// Icon
|
||||
$idicon = $form->get('idicon')->getData();
|
||||
|
@ -713,20 +714,6 @@ class GroupController extends Controller
|
|||
$em->persist($data);
|
||||
$em->flush();
|
||||
|
||||
// Si acces par user on ajoute forcement le owner comme membre du groupe en tant que manager
|
||||
/*
|
||||
if($access=="user") {
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
$usergroup->setUser($this->getUser());
|
||||
$usergroup->setGroup($data);
|
||||
$usergroup->setFgmanager(true);
|
||||
$usergroup->setKeyvalue($key);
|
||||
$em->persist($usergroup);
|
||||
$em->flush();
|
||||
}
|
||||
*/
|
||||
|
||||
// On s'assure que le propriétaire est bien membre du groupe
|
||||
$this->ctrlOwner($data);
|
||||
|
||||
|
@ -932,7 +919,7 @@ class GroupController extends Controller
|
|||
protected function ctrlOwner($group) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
if($group->getOwner()) {
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["user"=>$group->getOwner()]);
|
||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
|
||||
if(!$usergroup) {
|
||||
$key = Uuid::uuid4();
|
||||
$usergroup=new Usergroup;
|
||||
|
|
Loading…
Reference in New Issue