mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
Navigation: Allow basic wildcard to share navigation items
This commit is contained in:
parent
b80cfe7cdc
commit
c7d5e1456a
@ -151,7 +151,7 @@ class Web extends EmbeddedWeb
|
|||||||
|
|
||||||
if (isset($config['users'])) {
|
if (isset($config['users'])) {
|
||||||
$users = array_map('trim', explode(',', strtolower($config['users'])));
|
$users = array_map('trim', explode(',', strtolower($config['users'])));
|
||||||
if (in_array($this->user->getUsername(), $users, true)) {
|
if (in_array('*', $users, true) || in_array($this->user->getUsername(), $users, true)) {
|
||||||
unset($config['users']);
|
unset($config['users']);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -159,6 +159,11 @@ class Web extends EmbeddedWeb
|
|||||||
|
|
||||||
if (isset($config['groups'])) {
|
if (isset($config['groups'])) {
|
||||||
$groups = array_map('trim', explode(',', strtolower($config['groups'])));
|
$groups = array_map('trim', explode(',', strtolower($config['groups'])));
|
||||||
|
if (in_array('*', $groups, true)) {
|
||||||
|
unset($config['groups']);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$userGroups = array_map('strtolower', $this->user->getGroups());
|
$userGroups = array_map('strtolower', $this->user->getGroups());
|
||||||
$matches = array_intersect($userGroups, $groups);
|
$matches = array_intersect($userGroups, $groups);
|
||||||
if (! empty($matches)) {
|
if (! empty($matches)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user