diff --git a/install.php b/install.php index 3e4a033..4bbc094 100644 --- a/install.php +++ b/install.php @@ -793,18 +793,23 @@ function Setup_RealTime() // Check extconfig file for correct connector values $ext_conf = ''; - $ext_conf_file = 'extconfig.conf'; + $ext_conf_file = ''; $backup_ext = array('_custom.conf', '_additional.conf','.conf'); foreach ($backup_ext as $value) { if (file_exists($dir . '/extconfig' . $value)) { // Last possibility is normal file extconfig.conf - $ext_conf_file = 'extconfig' . $value; + $ext_conf_file = $dir . 'extconfig' . $value; $ext_conf = $cnf_read->getConfig($ext_conf_file); break; } } + if (empty($ext_conf_file)) { + // Have not found a file, so will need to create. $ext_conf must be empty + $ext_conf_file = $dir . '/extconfig.conf'; + } if (!empty($ext_conf)) { + // Have found a file and read a config. Now need to check required settings $currentExtSettings = array(); $writeExtSettings = $ext_conf; if (empty($ext_conf['settings']['sccpdevice']) || ($ext_conf['settings']['sccpdevice'] !== $def_ext_config['sccpdevice'])) { @@ -816,9 +821,15 @@ function Setup_RealTime() $writeExtSettings['settings']['sccpline'] = $def_ext_config['sccpline']; } if (!empty($writeExtSettings)) { - outn("
  • " . _("Updating extconfig file ...") . "
  • "); + outn("
  • " . _("Updating extconfig file ... ") . $ext_conf_file . "
  • "); $cnf_wr->writeConfig($ext_conf_file, $writeExtSettings); } + } else { + // Either did not find file or file did not contain any config, so create and fill + outn("
  • " . _("Creating extconfig file ... ") . . $ext_conf_file . "
  • "); + $writeExtSettings['settings']['sccpdevice'] = $def_ext_config['sccpdevice']; + $writeExtSettings['settings']['sccpline'] = $def_ext_config['sccpline']; + $cnf_wr->writeConfig($ext_conf_file, $writeExtSettings); } // Check database settings diff --git a/module.xml b/module.xml index 4ed9ca8..ce0761e 100644 --- a/module.xml +++ b/module.xml @@ -30,7 +30,7 @@ - + @@ -115,14 +115,14 @@ - +
    - + @@ -134,11 +134,11 @@
    - - + + - +