|
@@ -37,6 +37,7 @@ function Crowi(rootdir, env) {
|
|
|
this.mailer = {};
|
|
this.mailer = {};
|
|
|
this.interceptorManager = {};
|
|
this.interceptorManager = {};
|
|
|
this.passportService = null;
|
|
this.passportService = null;
|
|
|
|
|
+ this.globalNotificationService = null;
|
|
|
this.xss = new Xss();
|
|
this.xss = new Xss();
|
|
|
|
|
|
|
|
this.tokens = null;
|
|
this.tokens = null;
|
|
@@ -90,6 +91,8 @@ Crowi.prototype.init = function() {
|
|
|
return self.setupSlack();
|
|
return self.setupSlack();
|
|
|
}).then(function() {
|
|
}).then(function() {
|
|
|
return self.setupCsrf();
|
|
return self.setupCsrf();
|
|
|
|
|
+ }).then(function() {
|
|
|
|
|
+ return self.setUpGlobalNotification();
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -246,6 +249,10 @@ Crowi.prototype.getInterceptorManager = function() {
|
|
|
return this.interceptorManager;
|
|
return this.interceptorManager;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+Crowi.prototype.getGlobalNotificationService = function() {
|
|
|
|
|
+ return this.globalNotificationService;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
Crowi.prototype.setupPassport = function() {
|
|
Crowi.prototype.setupPassport = function() {
|
|
|
const config = this.getConfig();
|
|
const config = this.getConfig();
|
|
|
const Config = this.model('Config');
|
|
const Config = this.model('Config');
|
|
@@ -452,4 +459,15 @@ Crowi.prototype.require = function(modulePath) {
|
|
|
return require(modulePath);
|
|
return require(modulePath);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * setup Express Routes
|
|
|
|
|
+ * !! this must be at last because it includes '/*' route !!
|
|
|
|
|
+ */
|
|
|
|
|
+Crowi.prototype.setUpGlobalNotification = function() {
|
|
|
|
|
+ const globalNotificationService = require('../service/global-notification');
|
|
|
|
|
+ if (this.globalNotificationService == null) {
|
|
|
|
|
+ this.globalNotificationService = new globalNotificationService(this);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
module.exports = Crowi;
|
|
module.exports = Crowi;
|