From: Christian Weiske Date: Wed, 9 Apr 2014 18:47:16 +0000 (+0200) Subject: add setup check for access rights X-Git-Tag: v0.1.0~23 X-Git-Url: https://git.cweiske.de/phancap.git/commitdiff_plain/4257ca9320281606be23efac2e9a6e2ddedcb6d5 add setup check for access rights --- diff --git a/www/setup.php b/www/setup.php index 747699a..d89cf18 100644 --- a/www/setup.php +++ b/www/setup.php @@ -17,7 +17,18 @@ $messages = array(); $config = new Config(); try { $config->load(); - $messages[][] = array('ok', 'Configuration check ok'); + $messages[][] = array('ok', 'Base configuration is ok'); + + if ($config->access === true) { + $messages[][] = array('ok', 'Everyone may access the API'); + } else if ($config->access === false) { + $messages[][] = array('err', 'API access is disabled'); + } else { + $messages[][] = array( + 'ok', + count($config->access) . ' users may access the API' + ); + } } catch (\Exception $e) { $messages[][] = array('err', $e->getMessage()); } @@ -53,7 +64,7 @@ $out = <<