mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°1933: Security hardening
This commit is contained in:
@@ -1135,7 +1135,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)
|
||||
{
|
||||
@@ -1145,6 +1145,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
|
||||
|
||||
@@ -149,8 +149,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user