|
|
@@ -14,6 +14,8 @@ module.exports = function(crowi, app) {
|
|
|
const GlobalNotificationMailSetting = models.GlobalNotificationMailSetting;
|
|
|
const GlobalNotificationSlackSetting = models.GlobalNotificationSlackSetting; // eslint-disable-line no-unused-vars
|
|
|
|
|
|
+ const { configManager } = crowi;
|
|
|
+
|
|
|
const recommendedWhitelist = require('@commons/service/xss/recommended-whitelist');
|
|
|
const PluginUtils = require('../plugins/plugin-utils');
|
|
|
const ApiResponse = require('../util/apiResponse');
|
|
|
@@ -90,7 +92,7 @@ module.exports = function(crowi, app) {
|
|
|
// app.get('/admin/app' , admin.app.index);
|
|
|
actions.app = {};
|
|
|
actions.app.index = function(req, res) {
|
|
|
- const settingForm = Config.setupConfigFormData('crowi', req.config);
|
|
|
+ const settingForm = configManager.getConfigByPrefix('crowi', 'app');
|
|
|
|
|
|
return res.render('admin/app', {
|
|
|
settingForm,
|
|
|
@@ -103,16 +105,16 @@ module.exports = function(crowi, app) {
|
|
|
// app.get('/admin/security' , admin.security.index);
|
|
|
actions.security = {};
|
|
|
actions.security.index = function(req, res) {
|
|
|
- const settingForm = Config.setupConfigFormData('crowi', req.config);
|
|
|
- const isAclEnabled = !Config.isPublicWikiOnly(req.config);
|
|
|
+ const settingForm = configManager.getConfigByPrefix('crowi', 'security');
|
|
|
+ const isAclEnabled = crowi.aclService.getIsPublicWikiOnly();
|
|
|
+
|
|
|
return res.render('admin/security', { settingForm, isAclEnabled });
|
|
|
};
|
|
|
|
|
|
// app.get('/admin/markdown' , admin.markdown.index);
|
|
|
actions.markdown = {};
|
|
|
actions.markdown.index = function(req, res) {
|
|
|
- const config = crowi.getConfig();
|
|
|
- const markdownSetting = Config.setupConfigFormData('markdown', config);
|
|
|
+ const markdownSetting = configManager.getConfigByPrefix('crowi', 'markdown');
|
|
|
|
|
|
return res.render('admin/markdown', {
|
|
|
markdownSetting,
|
|
|
@@ -188,7 +190,7 @@ module.exports = function(crowi, app) {
|
|
|
// app.get('/admin/customize' , admin.customize.index);
|
|
|
actions.customize = {};
|
|
|
actions.customize.index = function(req, res) {
|
|
|
- const settingForm = Config.setupConfigFormData('crowi', req.config);
|
|
|
+ const settingForm = configManager.getConfigByPrefix('crowi', 'customize');
|
|
|
|
|
|
/* eslint-disable quote-props, no-multi-spaces */
|
|
|
const highlightJsCssSelectorOptions = {
|
|
|
@@ -216,7 +218,7 @@ module.exports = function(crowi, app) {
|
|
|
actions.notification.index = async(req, res) => {
|
|
|
const config = crowi.getConfig();
|
|
|
const UpdatePost = crowi.model('UpdatePost');
|
|
|
- let slackSetting = Config.setupConfigFormData('notification', config);
|
|
|
+ let slackSetting = configManager.getConfigByPrefix('notification', 'slack');
|
|
|
const hasSlackIwhUrl = Config.hasSlackIwhUrl(config);
|
|
|
const hasSlackToken = Config.hasSlackToken(config);
|
|
|
|
|
|
@@ -851,7 +853,7 @@ module.exports = function(crowi, app) {
|
|
|
// Importer management
|
|
|
actions.importer = {};
|
|
|
actions.importer.index = function(req, res) {
|
|
|
- const settingForm = Config.setupConfigFormData('crowi', req.config);
|
|
|
+ const settingForm = configManager.getConfigByPrefix('crowi', 'importer');
|
|
|
|
|
|
return res.render('admin/importer', {
|
|
|
settingForm,
|