From 4257ca9320281606be23efac2e9a6e2ddedcb6d5 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 9 Apr 2014 20:47:16 +0200 Subject: [PATCH 1/1] add setup check for access rights --- www/setup.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 = <<