[icinga-checkins] icinga.org: icingaweb2/master: Don' t rely on case sensitive usernames in navigation items stored in INI files

git at icinga.org git at icinga.org
Thu Feb 11 13:55:36 CET 2016


Module: icingaweb2
Branch: master
Commit: a5924f2ca860194153214d4dad0b03c2ed3a1e2a
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=a5924f2ca860194153214d4dad0b03c2ed3a1e2a

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Wed Feb 10 16:22:51 2016 +0100

Don't rely on case sensitive usernames in navigation items stored in INI files

refs #11051

---

 library/Icinga/Application/Web.php |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php
index d179398..d053542 100644
--- a/library/Icinga/Application/Web.php
+++ b/library/Icinga/Application/Web.php
@@ -172,7 +172,7 @@ class Web extends EmbeddedWeb
     {
         // 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']);
@@ -195,7 +195,7 @@ class Web extends EmbeddedWeb
 
         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']);



More information about the icinga-checkins mailing list