Merge remote-tracking branch 'origin/support/2.5' into release/2.6

# Conflicts:
#	install.txt
This commit is contained in:
Pierre Goiffon
2019-01-09 10:51:11 +01:00
4 changed files with 20 additions and 7 deletions

View File

@@ -1171,7 +1171,7 @@ class utils
}
}
/**
* Get target configuration file name (including full path)
* @return string target configuration file name (including full path)
*/
public static function GetConfigFilePath($sEnvironment = null)
{
@@ -1181,6 +1181,17 @@ class utils
}
return APPCONF.$sEnvironment.'/'.ITOP_CONFIG_FILE;
}
/**
* @return string target configuration file name (including relative path)
*/
public static function GetConfigFilePathRelative($sEnvironment = null)
{
if (is_null($sEnvironment))
{
$sEnvironment = self::GetCurrentEnvironment();
}
return "conf/".$sEnvironment.'/'.ITOP_CONFIG_FILE;
}
/**
* @return string the absolute URL to the modules root path

View File

@@ -176,8 +176,9 @@ try
$sConfigFile = utils::GetConfigFilePath();
if (file_exists($sConfigFile) && !is_writable($sConfigFile) && $oStep->RequiresWritableConfig())
{
$oPage->error("<b>Error:</b> the configuration file '".$sConfigFile."' already exists and cannot be overwritten.");
$oPage->p("The wizard cannot modify the configuration file for you. If you want to upgrade ".ITOP_APPLICATION.", make sure that the file '<b>".realpath($sConfigFile)."</b>' can be modified by the web server.");
$sRelativePath = utils::GetConfigFilePathRelative();
$oPage->error("<b>Error:</b> the configuration file '".$sRelativePath."' already exists and cannot be overwritten.");
$oPage->p("The wizard cannot modify the configuration file for you. If you want to upgrade ".ITOP_APPLICATION.", make sure that the file '<b>".$sRelativePath."</b>' can be modified by the web server.");
$oPage->output();
}
else

View File

@@ -124,7 +124,7 @@ function CheckEmailSetting($oP)
$oP->info("SMTP configuration (from config-itop.php): host: $sHost, port: $sPort, user: $sDisplayUserName, password: $sDisplayPassword, encryption: $sDisplayEncryption.");
if (($sHost == 'localhost') && ($sPort == '25') && ($sUserName == '') && ($sPassword == '') )
{
$oP->warning("The default settings may not be suitable for your environment. You may want to ajust these values by editing iTop's configuration file (".APPROOT."conf/production/config-itop.php).");
$oP->warning("The default settings may not be suitable for your environment. You may want to adjust these values by editing iTop's configuration file (".utils::GetConfigFilePathRelative().").");
}
break;
@@ -134,7 +134,7 @@ function CheckEmailSetting($oP)
break;
case 'LogFile':
$oP->warning("iTop is configured to use the <b>LogFile</b> transport: emails will <em>not</em> be sent but logged to the file: '".APPROOT."/log/mail.log'.");
$oP->warning("iTop is configured to use the <b>LogFile</b> transport: emails will <em>not</em> be sent but logged to the file: 'log/mail.log'.");
$bRet = true;
break;

View File

@@ -173,10 +173,11 @@ class WizardController
// The configuration file already exists
if (!is_writable($sConfigFile))
{
$sRelativePath = utils::GetConfigFilePathRelative();
$oP = new SetupPage('Installation Cannot Continue');
$oP->add("<h2>Fatal error</h2>\n");
$oP->error("<b>Error:</b> the configuration file '".$sConfigFile."' already exists and cannot be overwritten.");
$oP->p("The wizard cannot modify the configuration file for you. If you want to upgrade ".ITOP_APPLICATION.", make sure that the file '<b>".realpath($sConfigFile)."</b>' can be modified by the web server.");
$oP->error("<b>Error:</b> the configuration file '".$sRelativePath."' already exists and cannot be overwritten.");
$oP->p("The wizard cannot modify the configuration file for you. If you want to upgrade ".ITOP_APPLICATION.", make sure that the file '<b>".$sRelativePath."</b>' can be modified by the web server.");
$oP->p('<button type="button" onclick="window.location.reload()">Reload</button>');
$oP->output();
return;