index.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. $sConfigFile = 'conf/production/config-itop.php';
  3. $sStartPage = './pages/UI.php';
  4. $sSetupPage = './setup/index.php';
  5. /**
  6. * Check that the configuration file exists and has the appropriate access rights
  7. * If the file does not exist, launch the configuration wizard to create it
  8. */
  9. if (file_exists(dirname(__FILE__).'/'.$sConfigFile))
  10. {
  11. if (!is_readable($sConfigFile))
  12. {
  13. echo "<p><b>Error</b>: Unable to read the configuration file: '$sConfigFile'. Please check the access rights on this file.</p>";
  14. }
  15. else if (is_writable($sConfigFile))
  16. {
  17. echo "<p><b>Security Warning</b>: the configuration file '$sConfigFile' should be read-only.</p>";
  18. echo "<p>Please modify the access rights to this file.</p>";
  19. echo "<p>Click <a href=\"$sStartPage\">here</a> to ignore this warning and continue to run iTop.</p>";
  20. }
  21. else
  22. {
  23. header("Location: $sStartPage");
  24. }
  25. }
  26. else
  27. {
  28. // Config file does not exist, need to run the setup wizard to create it
  29. header("Location: $sSetupPage");
  30. }
  31. ?>