X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=src%2Fphpclasses%2Fconfiguration.class.php5;h=88419e25d2b0f46e212fa40ef2e126d7dd32247a;hb=039a1cc712312a8a8c44b0ab788e36daa95328af;hp=68c529e4b33777c7b2254b00df395150f6e271d6;hpb=2fad0a6e2843b5a5f9fce4c69abc2051f0f371f3;p=gnucomo.git diff --git a/src/phpclasses/configuration.class.php5 b/src/phpclasses/configuration.class.php5 index 68c529e..88419e2 100644 --- a/src/phpclasses/configuration.class.php5 +++ b/src/phpclasses/configuration.class.php5 @@ -86,28 +86,33 @@ class configuration } } - if (isset($_ENV['HOME']) && $_ENV['HOME'] != '/') + // First try the user's config in the current dir. + $filename = $app_name . ".conf"; + if (!is_readable($filename)) { - // Read configurations from the user's homedir. - - $filename = $_ENV['HOME'] . "/." . $app_name . ".conf"; - if (is_readable($filename)) + print("Can not read $filename"); + if (isset($_ENV['HOME']) && $_ENV['HOME'] != '/') { + // Read configurations from the user's homedir. + + $filename = $_ENV['HOME'] . "/." . $app_name . ".conf"; + } + } + if (is_readable($filename)) + { - $this->user = new DOMDocument(); + $this->user = new DOMDocument(); + if ($this->user->load($filename)) + { + $root = $this->user->documentElement; - if ($this->user->load($filename)) + if ($root->tagName != $app_name) { - $root = $this->user->documentElement; - - if ($root->tagName != $app_name) - { - print("Configuration error: Wrong configuration file.
"); - $this->user = false; - } + print("Configuration error: Wrong configuration file.
"); + $this->user = false; } } - + } if ($this->system == false && $this->user == false)