X-Git-Url: https://git.cweiske.de/phancap.git/blobdiff_plain/4257ca9320281606be23efac2e9a6e2ddedcb6d5..09ad15fd2ed08bbfb4ed4d70ff21f774387aa204:/www/setup.php diff --git a/www/setup.php b/www/setup.php index d89cf18..a49a7ae 100644 --- a/www/setup.php +++ b/www/setup.php @@ -1,8 +1,17 @@ + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/phancap.htm */ +namespace phancap; header('HTTP/1.0 500 Internal Server Error'); if (file_exists(__DIR__ . '/../src/phancap/Autoloader.php')) { @@ -17,6 +26,12 @@ $messages = array(); $config = new Config(); try { $config->load(); + if ($config->disableSetup) { + header('HTTP/1.0 403 Forbidden'); + header('Content-type: text/plain'); + echo "Setup check is disabled.\n"; + exit(1); + } $messages[][] = array('ok', 'Base configuration is ok'); if ($config->access === true) { @@ -29,6 +44,21 @@ try { count($config->access) . ' users may access the API' ); } + + foreach ($config->cfgFiles as $cfgFile) { + $messages[][] = array( + 'info', 'Possible config file: ' . $cfgFile + ); + } + if ($config->cfgFileExists) { + $messages[][] = array( + 'ok', 'Configuration file loaded' + ); + } else { + $messages[][] = array( + 'info', 'No configuration file found' + ); + } } catch (\Exception $e) { $messages[][] = array('err', $e->getMessage()); } @@ -52,41 +82,68 @@ foreach ($adapter as $classpart) { } } -header('HTTP/1.0 200 OK'); - $out = << - + + phancap setup check + + + + -

phancap setup check

-