Add access restriction

This commit is contained in:
Romain Neutron
2014-02-24 10:42:31 +01:00
parent 4535491e6c
commit 878c96f6d4
11 changed files with 232 additions and 18 deletions

View File

@@ -424,9 +424,13 @@ class appbox extends base
$ret = [];
foreach ($this->retrieve_sbas_ids() as $sbas_id) {
try {
$ret[$sbas_id] = new \databox($this->app, $sbas_id);
$databox = new \databox($this->app, $sbas_id);
if (!$this->app['conf.restrictions']->isDataboxAvailable($databox)) {
continue;
}
$ret[$sbas_id] = $databox;
} catch (NotFoundHttpException $e) {
$this->app['monolog']->error(sprintf('Databox %s is not reliable.', $databox->getId()));
}
}