From c7d5e1456ae424f43228ab0c40ddab3fb387fc82 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 1 Oct 2015 13:56:28 +0200 Subject: [PATCH] Navigation: Allow basic wildcard to share navigation items --- library/Icinga/Application/Web.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index da11b9c1e..8f8131095 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -151,7 +151,7 @@ class Web extends EmbeddedWeb if (isset($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']); return true; } @@ -159,6 +159,11 @@ class Web extends EmbeddedWeb if (isset($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()); $matches = array_intersect($userGroups, $groups); if (! empty($matches)) {