Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Make sure ldap groups are really removed instead of disabled because …
Browse files Browse the repository at this point in the history
…they are simply not managed in Grouphub.
  • Loading branch information
Tjeerd committed Jul 8, 2016
1 parent 54a086a commit 76facb3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/AppBundle/Manager/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ public function deleteGroup(UserGroup $group)
throw new \InvalidArgumentException('Parent groups cannot be disabled');
}

$group->setActive(0);
$this->dispatcher->dispatch('app.event.group.delete', new GroupEvent($group));

$this->doctrine->getManager()->flush();
$em = $this->doctrine->getManager();

$this->dispatcher->dispatch('app.event.group.delete', new GroupEvent($group));
if ($group->getType() !== UserGroup::TYPE_LDAP) {
$group->setActive(0);
} else {
$em->remove($group);
}

$em->flush();
}
}

0 comments on commit 76facb3

Please sign in to comment.