mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Admin will now be able to re-launch the iTop setup directly from the administration console in the Administration / Application Upgrade screen. Before the only way to launch setup on an existing iTop instance was to change permissions on the configuration file. This button will be enabled depending on the isDevEnv (if true it will be displayed) and `setup.launch_button.enabled` new configuration parameter (not present by default ; if set to false will always hide the button, if set to true will always display it, if not set will display button depending on isDevEnv only). Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
$sConfigFile = 'conf/production/config-itop.php';
|
|
$sStartPage = './pages/UI.php';
|
|
$sSetupPage = './setup/index.php';
|
|
|
|
require_once('approot.inc.php');
|
|
|
|
/**
|
|
* Check that the configuration file exists and has the appropriate access rights
|
|
* If the file does not exist, launch the configuration wizard to create it
|
|
*/
|
|
if (file_exists(dirname(__FILE__).'/'.$sConfigFile))
|
|
{
|
|
if (!is_readable($sConfigFile))
|
|
{
|
|
echo "<p><b>Error</b>: Unable to read the configuration file: '$sConfigFile'. Please check the access rights on this file.</p>";
|
|
}
|
|
else if (is_writable($sConfigFile))
|
|
{
|
|
require_once (APPROOT.'setup/setuputils.class.inc.php');
|
|
if (SetupUtils::IsInReadOnlyMode())
|
|
{
|
|
echo "<p><b>Warning</b>: the application is currently in maintenance, please wait.</p>";
|
|
echo "<p>Click <a href=\"$sStartPage\">here</a> to ignore this warning and continue to run iTop in read-only mode.</p>";
|
|
}
|
|
else
|
|
{
|
|
echo <<<HTML
|
|
<p><b>Security Warning</b>: the configuration file '{$sConfigFile}' should be read-only.</p>
|
|
<p>Please modify the access rights to this file.</p>
|
|
<p>Click <a href="{$sStartPage}">here</a> to ignore this warning and continue to run iTop.</p>
|
|
HTML;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
header("Location: $sStartPage");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// Config file does not exist, need to run the setup wizard to create it
|
|
header("Location: $sSetupPage");
|
|
}
|