|
|
@@ -3,6 +3,7 @@ module.exports = function(crowi, app, req, locals) {
|
|
|
, Page = crowi.model('Page')
|
|
|
, Config = crowi.model('Config')
|
|
|
, User = crowi.model('User')
|
|
|
+ , passportService = crowi.passportService
|
|
|
;
|
|
|
|
|
|
locals.nodeVersion = function() {
|
|
|
@@ -24,9 +25,20 @@ module.exports = function(crowi, app, req, locals) {
|
|
|
return req.csrfToken;
|
|
|
};
|
|
|
|
|
|
- locals.isEnabledLdap = function() {
|
|
|
+ /**
|
|
|
+ * return true if enabled and strategy has been setup successfully
|
|
|
+ */
|
|
|
+ locals.isLdapSetup = function() {
|
|
|
var config = crowi.getConfig()
|
|
|
- return Config.isEnabledPassport(config) && Config.isEnabledLdap(config);
|
|
|
+ return Config.isEnabledPassport(config) && Config.isEnabledPassportLdap(config) && passportService.isLdapStrategySetup;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * return true if enabled but strategy has some problem
|
|
|
+ */
|
|
|
+ locals.isLdapSetupFailed = function() {
|
|
|
+ var config = crowi.getConfig()
|
|
|
+ return Config.isEnabledPassport(config) && Config.isEnabledPassportLdap(config) && !passportService.isLdapStrategySetup;
|
|
|
}
|
|
|
|
|
|
locals.googleLoginEnabled = function() {
|