Skip to content

Commit

Permalink
Preferences: Use the lowercase username
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Nov 19, 2014
1 parent 3b190d7 commit 74683ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/Icinga/User/Preferences/Store/IniStore.php
Expand Up @@ -46,7 +46,7 @@ protected function init()
$this->preferencesFile = sprintf(
'%s/%s.ini',
$this->getStoreConfig()->location,
$this->getUser()->getUsername()
strtolower($this->getUser()->getUsername())
);
}

Expand All @@ -60,7 +60,7 @@ protected function init()
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,
Expand Down Expand Up @@ -99,8 +99,8 @@ public function save(Preferences $preferences)
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
Expand All @@ -110,7 +110,7 @@ public function write()
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,
Expand Down

0 comments on commit 74683ea

Please sign in to comment.