add setup check for access rights
[phancap.git] / www / setup.php
index 747699a3d283c59beca204d245ddd774424a1eaf..d89cf18ab97edc098b175768a944ed98cfaba098 100644 (file)
@@ -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 = <<<HTM
         content: '✔';
         color: green;
         padding: 0 0.5ex;
-        margin-right: 1ex;
+        margin-right: 0.5ex;
     }
     li.err:before {
         content: "✘";