UserController: Do not show duplicate memberships when showing a user
refs #8826
This commit is contained in:
parent
170379b743
commit
32c1a844b5
|
@ -248,10 +248,15 @@ class UserController extends AuthBackendController
|
|||
*/
|
||||
protected function loadMemberships(User $user)
|
||||
{
|
||||
$groups = array();
|
||||
$groups = $alreadySeen = array();
|
||||
foreach ($this->loadUserGroupBackends() as $backend) {
|
||||
try {
|
||||
foreach ($backend->getMemberships($user) as $groupName) {
|
||||
if (array_key_exists($groupName, $alreadySeen)) {
|
||||
continue; // Ignore duplicate memberships
|
||||
}
|
||||
|
||||
$alreadySeen[$groupName] = null;
|
||||
$groups[] = (object) array(
|
||||
'group_name' => $groupName,
|
||||
'backend' => $backend
|
||||
|
|
Loading…
Reference in New Issue