mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 05:14:25 +02:00
UserGroupController: Properly handle errors when fetching memberships
refs #8826
This commit is contained in:
parent
adc2d33814
commit
45fd1b78f1
@ -250,12 +250,20 @@ class UserController extends AuthBackendController
|
|||||||
{
|
{
|
||||||
$groups = array();
|
$groups = array();
|
||||||
foreach ($this->loadUserGroupBackends() as $backend) {
|
foreach ($this->loadUserGroupBackends() as $backend) {
|
||||||
|
try {
|
||||||
foreach ($backend->getMemberships($user) as $groupName) {
|
foreach ($backend->getMemberships($user) as $groupName) {
|
||||||
$groups[] = (object) array(
|
$groups[] = (object) array(
|
||||||
'group_name' => $groupName,
|
'group_name' => $groupName,
|
||||||
'backend' => $backend
|
'backend' => $backend
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Logger::error($e);
|
||||||
|
Notification::warning(sprintf(
|
||||||
|
$this->translate('Failed to fetch memberships from backend %s. Please check your log'),
|
||||||
|
$backend->getName()
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayDatasource($groups);
|
return new ArrayDatasource($groups);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user