Skip to content

Commit cfb3442

Browse files
committed
fix: Check for config file in var/config/ before checking vendor/horde//config
1 parent 592c3b5 commit cfb3442

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

admin/config/index.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,19 @@ function _uploadFTP($params)
226226
if (!file_exists($path . '/conf.xml')) {
227227
$apps[$i]['conf'] = $apps[$i]['status'] = '';
228228
} else {
229-
if (!file_exists($path . '/conf.php')) {
229+
// Check var/config/$app first
230+
$foundConfig = false;
231+
if (defined('HORDE_CONFIG_BASE')) {
232+
$configFilePath = HORDE_CONFIG_BASE . DIRECTORY_SEPARATOR . $app . DIRECTORY_SEPARATOR . 'conf.php';
233+
$foundConfig = file_exists($configFilePath);
234+
}
235+
if (!$foundConfig) {
236+
$configFilePath = $path . '/conf.php';
237+
$foundConfig = file_exists($configFilePath);
238+
}
239+
240+
241+
if (!$foundConfig) {
230242
/* No conf.php exists. */
231243
$apps[$i]['conf'] = $conf_link . $error . '</a>';
232244
$apps[$i]['status'] = $conf_link . _("Missing configuration.") . '</a>';
@@ -242,7 +254,7 @@ function _uploadFTP($params)
242254
$xml_ver = $hconfig->getVersion($contentXml);
243255
}
244256
/* Get the generated php version. */
245-
$contentPhp = @file_get_contents($path . '/conf.php');
257+
$contentPhp = @file_get_contents($configFilePath);
246258
if (!$contentPhp) {
247259
$apps[$i]['conf'] = $conf_link . $warning . '</a>';
248260
$apps[$i]['status'] = $conf_link . _("Cannot read configuration file conf.php.") . '</a>';

0 commit comments

Comments
 (0)