diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index e9b6028bb..89597be3d 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -151,9 +151,9 @@ abstract class ApplicationBootstrap $configDir = '/etc/icingaweb'; } } - $this->configDir = realpath($configDir); - if (!$this->configDir) { - $this->configDir = '/etc/icingaweb'; + $canonical = realpath($configDir); + if ($canonical) { + $this->configDir = $canonical; } $this->setupAutoloader(); diff --git a/library/Icinga/Application/Config.php b/library/Icinga/Application/Config.php index 7070e982c..8771faa10 100644 --- a/library/Icinga/Application/Config.php +++ b/library/Icinga/Application/Config.php @@ -165,16 +165,6 @@ class Config extends Zend_Config */ public static function resolvePath($path) { - if (Platform::isWindows()) { - throw new ProgrammingError('Windows support has not yet been implemented'); - } - - if (strpos(dirname($path), DIRECTORY_SEPARATOR) === 0) { - return $path; - } - - $path = self::$configDir . DIRECTORY_SEPARATOR . $path; - $canonical = realpath($path); - return ($canonical === false) ? $path : $canonical; + return self::$configDir . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR); } } diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index 410e8f26e..81d47b394 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -132,7 +132,7 @@ abstract class PreferencesStore } if ($type === 'Ini') { - $config->location = $config->config_path; + $config->location = IcingaConfig::resolvePath('preferences'); } elseif ($type === 'Db') { $config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource)); }