Skip to content

Commit

Permalink
Don't rely on case sensitive usernames in navigation items stored in …
Browse files Browse the repository at this point in the history
…INI files

refs #11051
  • Loading branch information
Al2Klimov committed Feb 10, 2016
1 parent 001c63e commit a5924f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Icinga/Application/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private function hasAccessToSharedNavigationItem(& $config, Config $navConfig)
{
// TODO: Provide a more sophisticated solution

if (isset($config['owner']) && $config['owner'] === $this->user->getUsername()) {
if (isset($config['owner']) && strtolower($config['owner']) === strtolower($this->user->getUsername())) {
unset($config['owner']);
unset($config['users']);
unset($config['groups']);
Expand All @@ -195,7 +195,7 @@ private function hasAccessToSharedNavigationItem(& $config, Config $navConfig)

if (isset($config['users'])) {
$users = array_map('trim', explode(',', strtolower($config['users'])));
if (in_array('*', $users, true) || in_array($this->user->getUsername(), $users, true)) {
if (in_array('*', $users, true) || in_array(strtolower($this->user->getUsername()), $users, true)) {
unset($config['owner']);
unset($config['users']);
unset($config['groups']);
Expand Down

0 comments on commit a5924f2

Please sign in to comment.