diff --git a/application/utils.inc.php b/application/utils.inc.php index 3ebc47bb3..f7f63b7ac 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -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 diff --git a/setup/ajax.dataloader.php b/setup/ajax.dataloader.php index c9036a55c..6dfbbd8a5 100644 --- a/setup/ajax.dataloader.php +++ b/setup/ajax.dataloader.php @@ -176,8 +176,9 @@ try $sConfigFile = utils::GetConfigFilePath(); if (file_exists($sConfigFile) && !is_writable($sConfigFile) && $oStep->RequiresWritableConfig()) { - $oPage->error("Error: 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 '".realpath($sConfigFile)."' can be modified by the web server."); + $sRelativePath = utils::GetConfigFilePathRelative(); + $oPage->error("Error: 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 '".$sRelativePath."' can be modified by the web server."); $oPage->output(); } else diff --git a/setup/email.test.php b/setup/email.test.php index da19a4880..e03bfc62f 100644 --- a/setup/email.test.php +++ b/setup/email.test.php @@ -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 LogFile transport: emails will not be sent but logged to the file: '".APPROOT."/log/mail.log'."); + $oP->warning("iTop is configured to use the LogFile transport: emails will not be sent but logged to the file: 'log/mail.log'."); $bRet = true; break; diff --git a/setup/wizardcontroller.class.inc.php b/setup/wizardcontroller.class.inc.php index bb091c571..ac991e4ce 100644 --- a/setup/wizardcontroller.class.inc.php +++ b/setup/wizardcontroller.class.inc.php @@ -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("

Fatal error

\n"); - $oP->error("Error: 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 '".realpath($sConfigFile)."' can be modified by the web server."); + $oP->error("Error: 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 '".$sRelativePath."' can be modified by the web server."); $oP->p(''); $oP->output(); return;