public function manageSettings()
{
$state = State::instance();
$settings = ['universal' => $state->universal];
$post = $this->post(new SettingsFilter());
if (!empty($post)) {
if ($this->saveSettings($post)) {
\Airship\clear_cache();
\Airship\redirect($this->airship_cabin_prefix . '/admin/settings', ['msg' => 'saved']);
} else {
$this->log('Could not save new settings', LogLevel::ALERT);
}
}
// Load individual files...
$settings['cabins'] = $this->loadJSONConfigFile('cabins.json');
$settings['content_security_policy'] = $this->loadJSONConfigFile('content_security_policy.json');
$settings['keyring'] = $this->loadJSONConfigFile('keyring.json');
foreach (\Airship\list_all_files(ROOT . '/config/supplier_keys/', 'json') as $supplier) {
$name = \Airship\path_to_filename($supplier, true);
$settings['suppliers'][$name] = \Airship\loadJSON($supplier);
}
$this->lens('admin_settings', ['active_link' => 'bridge-link-admin-settings', 'config' => $settings, 'groups' => $this->acct->getGroupTree()]);
}