Kaynağa Gözat

remove commented lines

mizozobu 6 yıl önce
ebeveyn
işleme
f3c6265fdd

+ 0 - 16
src/server/crowi/index.js

@@ -196,22 +196,6 @@ Crowi.prototype.setupSessionConfig = function() {
   }));
 };
 
-// Crowi.prototype.setupAppConfig = function() {
-//   return new Promise((resolve, reject) => {
-//     this.model('Config', require('../models/config')(this));
-//     const Config = this.model('Config');
-//     Config.loadAllConfig((err, doc) => {
-//       if (err) {
-//         return reject();
-//       }
-
-//       this.setConfig(doc);
-
-//       return resolve();
-//     });
-//   });
-// };
-
 Crowi.prototype.setupConfigManager = async function() {
   const ConfigManager = require('../service/config-manager');
   this.configManager = new ConfigManager(this.model('Config'));

+ 1 - 57
src/server/models/config.js

@@ -187,37 +187,8 @@ module.exports = function(crowi) {
 
   configSchema.statics.updateConfigCache = function(ns, config) {
     validateCrowi();
-
-    // const originalConfig = crowi.getConfig();
-    // const newNSConfig = originalConfig[ns] || {};
-    // Object.keys(config).forEach((key) => {
-    //   if (config[key] || config[key] === '' || config[key] === false) {
-    //     newNSConfig[key] = config[key];
-    //   }
-    // });
-
-    // originalConfig[ns] = newNSConfig;
-    // crowi.setConfig(originalConfig);
-
-    // // initialize custom css/script
-    // Config.initCustomCss(originalConfig);
-    // Config.initCustomScript(originalConfig);
   };
 
-  // Execute only once for installing application
-  // configSchema.statics.applicationInstall = function(callback) {
-  //   const Config = this;
-  //   Config.count({ ns: 'crowi' }, (err, count) => {
-  //     if (count > 0) {
-  //       return callback(new Error('Application already installed'), null);
-  //     }
-  //     Config.updateNamespaceByArray('crowi', getArrayForInstalling(), (err, configs) => {
-  //       Config.updateConfigCache('crowi', configs);
-  //       return callback(err, configs);
-  //     });
-  //   });
-  // };
-
   configSchema.statics.updateNamespaceByArray = function(ns, configs, callback) {
     const Config = this;
     if (configs.length < 0) {
@@ -248,34 +219,7 @@ module.exports = function(crowi) {
     );
   };
 
-  // configSchema.statics.loadAllConfig = function(callback) {
-  //   const Config = this;
-
-
-  //   const config = {};
-  //   config.crowi = {}; // crowi namespace
-
-  //   Config.find()
-  //     .sort({ ns: 1, key: 1 })
-  //     .exec((err, doc) => {
-  //       doc.forEach((el) => {
-  //         if (!config[el.ns]) {
-  //           config[el.ns] = {};
-  //         }
-  //         config[el.ns][el.key] = JSON.parse(el.value);
-  //       });
-
-  //       debug('Config loaded', config);
-
-  //       // initialize custom css/script
-  //       Config.initCustomCss(config);
-  //       Config.initCustomScript(config);
-
-  //       return callback(null, config);
-  //     });
-  // };
-
-  configSchema.statics.getLocalconfig = function() { // CONF.RF: これも別のメソッドにする
+  configSchema.statics.getLocalconfig = function() {
     const env = process.env;
 
     const localConfig = {

+ 0 - 20
src/server/routes/installer.js

@@ -89,26 +89,6 @@ module.exports = function(crowi, app) {
       req.flash('successMessage', 'GROWI のインストールが完了しました!はじめに、このページで各種設定を確認してください。');
       return res.redirect('/admin/app');
     });
-
-    // Config.applicationInstall((err, configs) => {
-    //   if (err) {
-    //     logger.error(err);
-    //     return;
-    //   }
-
-    //   // save the globalLang config, and update the config cache
-    //   Config.updateNamespaceByArray('crowi', { 'app:globalLang': language }, (err, config) => {
-    //     Config.updateConfigCache('crowi', config);
-    //   });
-
-    //   // login with passport
-    //   req.logIn(adminUser, (err) => {
-    //     if (err) { return next() }
-
-    //     req.flash('successMessage', 'GROWI のインストールが完了しました!はじめに、このページで各種設定を確認してください。');
-    //     return res.redirect('/admin/app');
-    //   });
-    // });
   };
 
   return actions;

+ 0 - 1
src/server/service/acl.js

@@ -16,7 +16,6 @@ class AclService {
   }
 
   getIsPublicWikiOnly() {
-    // CONF.RF save PUBLIC_WIKI_ONLY in mongodb?
     const publicWikiOnly = process.env.PUBLIC_WIKI_ONLY;
     if (publicWikiOnly === 'true' || publicWikiOnly === 1) {
       return true;