mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°8796 - Add PHP code style validation in iTop and extensions - format whole code base
This commit is contained in:
30
index.php
30
index.php
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
$sConfigFile = 'conf/production/config-itop.php';
|
||||
$sStartPage = './pages/UI.php';
|
||||
$sSetupPage = './setup/index.php';
|
||||
@@ -8,37 +9,26 @@ 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(APPROOT.$sConfigFile))
|
||||
{
|
||||
if (!is_readable($sConfigFile))
|
||||
{
|
||||
*/
|
||||
if (file_exists(APPROOT.$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())
|
||||
{
|
||||
} elseif (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
|
||||
{
|
||||
} 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
|
||||
{
|
||||
} else {
|
||||
header("Location: $sStartPage");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Config file does not exist, need to run the setup wizard to create it
|
||||
header("Location: $sSetupPage");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user