[icinga-checkins] icinga.org: icingaweb2/feature/security-gui-5647: Preferences: Use the lowercase username

git at icinga.org git at icinga.org
Thu Nov 20 09:18:16 CET 2014


Module: icingaweb2
Branch: feature/security-gui-5647
Commit: 74683ea0252259f98b852f3b3fad4a4771a724e2
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=74683ea0252259f98b852f3b3fad4a4771a724e2

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Wed Nov 19 15:40:59 2014 +0100

Preferences: Use the lowercase username

---

 library/Icinga/User/Preferences/Store/IniStore.php |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/library/Icinga/User/Preferences/Store/IniStore.php b/library/Icinga/User/Preferences/Store/IniStore.php
index 1a7efe7..1ba7801 100644
--- a/library/Icinga/User/Preferences/Store/IniStore.php
+++ b/library/Icinga/User/Preferences/Store/IniStore.php
@@ -46,7 +46,7 @@ class IniStore extends PreferencesStore
         $this->preferencesFile = sprintf(
             '%s/%s.ini',
             $this->getStoreConfig()->location,
-            $this->getUser()->getUsername()
+            strtolower($this->getUser()->getUsername())
         );
     }
 
@@ -60,7 +60,7 @@ class IniStore extends PreferencesStore
     public function load()
     {
         if (file_exists($this->preferencesFile)) {
-            if (!is_readable($this->preferencesFile)) {
+            if (! is_readable($this->preferencesFile)) {
                 throw new NotReadableError(
                     'Preferences INI file %s for user %s is not readable',
                     $this->preferencesFile,
@@ -99,8 +99,8 @@ class IniStore extends PreferencesStore
     public function write()
     {
         if ($this->writer === null) {
-            if (!file_exists($this->preferencesFile)) {
-                if (!is_writable($this->getStoreConfig()->location)) {
+            if (! file_exists($this->preferencesFile)) {
+                if (! is_writable($this->getStoreConfig()->location)) {
                     throw new NotWritableError(
                         'Path to the preferences INI files %s is not writable',
                         $this->getStoreConfig()->location
@@ -110,7 +110,7 @@ class IniStore extends PreferencesStore
                 File::create($this->preferencesFile, 0664);
             }
 
-            if (!is_writable($this->preferencesFile)) {
+            if (! is_writable($this->preferencesFile)) {
                 throw new NotWritableError(
                     'Preferences INI file %s for user %s is not writable',
                     $this->preferencesFile,



More information about the icinga-checkins mailing list