mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
add currentSetting to ReactiveCache
This commit is contained in:
parent
c6ee58ef88
commit
b7dbeba7de
13 changed files with 59 additions and 55 deletions
|
|
@ -3,9 +3,6 @@ import { TAPi18n } from '/imports/i18n';
|
||||||
const subManager = new SubsManager();
|
const subManager = new SubsManager();
|
||||||
|
|
||||||
Template.boardList.helpers({
|
Template.boardList.helpers({
|
||||||
currentSetting() {
|
|
||||||
return Settings.findOne();
|
|
||||||
},
|
|
||||||
hideCardCounterList() {
|
hideCardCounterList() {
|
||||||
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
|
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
|
||||||
return Utils.isMiniScreen() && Session.get('currentBoard'); */
|
return Utils.isMiniScreen() && Session.get('currentBoard'); */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { ReactiveCache } from '/imports/reactiveCache';
|
||||||
|
|
||||||
Meteor.subscribe('user-admin');
|
Meteor.subscribe('user-admin');
|
||||||
Meteor.subscribe('boards');
|
Meteor.subscribe('boards');
|
||||||
Meteor.subscribe('setting');
|
Meteor.subscribe('setting');
|
||||||
|
|
@ -9,7 +11,7 @@ Template.header.onCreated(function(){
|
||||||
|
|
||||||
Meteor.subscribe('setting', {
|
Meteor.subscribe('setting', {
|
||||||
onReady() {
|
onReady() {
|
||||||
templateInstance.currentSetting.set(Settings.findOne());
|
templateInstance.currentSetting.set(ReactiveCache.getCurrentSetting());
|
||||||
let currSetting = templateInstance.currentSetting.curValue;
|
let currSetting = templateInstance.currentSetting.curValue;
|
||||||
if(currSetting && currSetting !== undefined && currSetting.customLoginLogoImageUrl !== undefined && document.getElementById("headerIsSettingDatabaseCallDone") != null)
|
if(currSetting && currSetting !== undefined && currSetting.customLoginLogoImageUrl !== undefined && document.getElementById("headerIsSettingDatabaseCallDone") != null)
|
||||||
document.getElementById("headerIsSettingDatabaseCallDone").style.display = 'none';
|
document.getElementById("headerIsSettingDatabaseCallDone").style.display = 'none';
|
||||||
|
|
@ -24,10 +26,6 @@ Template.header.helpers({
|
||||||
return !Session.get('currentBoard');
|
return !Session.get('currentBoard');
|
||||||
},
|
},
|
||||||
|
|
||||||
currentSetting() {
|
|
||||||
return Settings.findOne();
|
|
||||||
},
|
|
||||||
|
|
||||||
hideLogo() {
|
hideLogo() {
|
||||||
return Utils.isMiniScreen() && Session.get('currentBoard');
|
return Utils.isMiniScreen() && Session.get('currentBoard');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { ReactiveCache } from '/imports/reactiveCache';
|
||||||
import { TAPi18n } from '/imports/i18n';
|
import { TAPi18n } from '/imports/i18n';
|
||||||
|
|
||||||
BlazeLayout.setRoot('body');
|
BlazeLayout.setRoot('body');
|
||||||
|
|
@ -28,7 +29,7 @@ Template.userFormsLayout.onCreated(function () {
|
||||||
|
|
||||||
Meteor.subscribe('setting', {
|
Meteor.subscribe('setting', {
|
||||||
onReady() {
|
onReady() {
|
||||||
templateInstance.currentSetting.set(Settings.findOne());
|
templateInstance.currentSetting.set(ReactiveCache.getCurrentSetting());
|
||||||
let currSetting = templateInstance.currentSetting.curValue;
|
let currSetting = templateInstance.currentSetting.curValue;
|
||||||
let oidcBtnElt = $("#at-oidc");
|
let oidcBtnElt = $("#at-oidc");
|
||||||
if(currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined){
|
if(currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined){
|
||||||
|
|
@ -85,10 +86,6 @@ Template.userFormsLayout.onRendered(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.userFormsLayout.helpers({
|
Template.userFormsLayout.helpers({
|
||||||
currentSetting() {
|
|
||||||
return Template.instance().currentSetting.get();
|
|
||||||
},
|
|
||||||
|
|
||||||
// isSettingDatabaseCallDone(){
|
// isSettingDatabaseCallDone(){
|
||||||
// return isSettingDatabaseFctCallDone;
|
// return isSettingDatabaseFctCallDone;
|
||||||
// },
|
// },
|
||||||
|
|
@ -164,7 +161,7 @@ Template.userFormsLayout.events({
|
||||||
},
|
},
|
||||||
'DOMSubtreeModified #at-oidc'(event) {
|
'DOMSubtreeModified #at-oidc'(event) {
|
||||||
if (alreadyCheck <= 2) {
|
if (alreadyCheck <= 2) {
|
||||||
let currSetting = Settings.findOne();
|
let currSetting = Utils.getCurrentSetting();
|
||||||
let oidcBtnElt = $("#at-oidc");
|
let oidcBtnElt = $("#at-oidc");
|
||||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||||
|
|
@ -185,7 +182,7 @@ Template.userFormsLayout.events({
|
||||||
'DOMSubtreeModified .at-form'(event) {
|
'DOMSubtreeModified .at-form'(event) {
|
||||||
if (alreadyCheck <= 2 && !isCheckDone) {
|
if (alreadyCheck <= 2 && !isCheckDone) {
|
||||||
if (document.getElementById("at-oidc") != null) {
|
if (document.getElementById("at-oidc") != null) {
|
||||||
let currSetting = Settings.findOne();
|
let currSetting = Utils.getCurrentSetting();
|
||||||
let oidcBtnElt = $("#at-oidc");
|
let oidcBtnElt = $("#at-oidc");
|
||||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
Template.invitationCode.onRendered(function() {
|
Template.invitationCode.onRendered(function() {
|
||||||
Meteor.subscribe('setting', {
|
Meteor.subscribe('setting', {
|
||||||
onReady() {
|
onReady() {
|
||||||
const setting = Settings.findOne();
|
const setting = Utils.getCurrentSetting();
|
||||||
|
|
||||||
if (!setting || !setting.disableRegistration) {
|
if (!setting || !setting.disableRegistration) {
|
||||||
$('#invitationcode').hide();
|
$('#invitationcode').hide();
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,6 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
currentSetting() {
|
|
||||||
return Settings.findOne();
|
|
||||||
},
|
|
||||||
|
|
||||||
boards() {
|
boards() {
|
||||||
return Boards.find(
|
return Boards.find(
|
||||||
{
|
{
|
||||||
|
|
@ -60,16 +56,16 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
toggleForgotPassword() {
|
toggleForgotPassword() {
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
const forgotPasswordClosed = this.currentSetting().disableForgotPassword;
|
const forgotPasswordClosed = Utils.getCurrentSetting().disableForgotPassword;
|
||||||
Settings.update(Settings.findOne()._id, {
|
Settings.update(Utils.getCurrentSetting()._id, {
|
||||||
$set: { disableForgotPassword: !forgotPasswordClosed },
|
$set: { disableForgotPassword: !forgotPasswordClosed },
|
||||||
});
|
});
|
||||||
this.setLoading(false);
|
this.setLoading(false);
|
||||||
},
|
},
|
||||||
toggleRegistration() {
|
toggleRegistration() {
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
const registrationClosed = this.currentSetting().disableRegistration;
|
const registrationClosed = Utils.getCurrentSetting().disableRegistration;
|
||||||
Settings.update(Settings.findOne()._id, {
|
Settings.update(Utils.getCurrentSetting()._id, {
|
||||||
$set: { disableRegistration: !registrationClosed },
|
$set: { disableRegistration: !registrationClosed },
|
||||||
});
|
});
|
||||||
this.setLoading(false);
|
this.setLoading(false);
|
||||||
|
|
@ -165,7 +161,7 @@ BlazeComponent.extendComponent({
|
||||||
.trim();
|
.trim();
|
||||||
const from = this.checkField('#mail-server-from');
|
const from = this.checkField('#mail-server-from');
|
||||||
const tls = $('#mail-server-tls.is-checked').length > 0;
|
const tls = $('#mail-server-tls.is-checked').length > 0;
|
||||||
Settings.update(Settings.findOne()._id, {
|
Settings.update(Utils.getCurrentSetting()._id, {
|
||||||
$set: {
|
$set: {
|
||||||
'mailServer.host': host,
|
'mailServer.host': host,
|
||||||
'mailServer.port': port,
|
'mailServer.port': port,
|
||||||
|
|
@ -245,7 +241,7 @@ BlazeComponent.extendComponent({
|
||||||
const spinnerName = $('#spinnerName').val();
|
const spinnerName = $('#spinnerName').val();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Settings.update(Settings.findOne()._id, {
|
Settings.update(Utils.getCurrentSetting()._id, {
|
||||||
$set: {
|
$set: {
|
||||||
productName,
|
productName,
|
||||||
hideLogo: hideLogoChange,
|
hideLogo: hideLogoChange,
|
||||||
|
|
|
||||||
|
|
@ -149,9 +149,6 @@ Template.homeSidebar.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.boardInfoOnMyBoardsPopup.helpers({
|
Template.boardInfoOnMyBoardsPopup.helpers({
|
||||||
currentSetting() {
|
|
||||||
return Settings.findOne();
|
|
||||||
},
|
|
||||||
hideCardCounterList() {
|
hideCardCounterList() {
|
||||||
return Utils.isMiniScreen() && Session.get('currentBoard');
|
return Utils.isMiniScreen() && Session.get('currentBoard');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Template.memberMenuPopup.helpers({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isSameDomainNameSettingValue(){
|
isSameDomainNameSettingValue(){
|
||||||
const currSett = Settings.findOne();
|
const currSett = Utils.getCurrentSetting();
|
||||||
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
||||||
currentUser = Meteor.user();
|
currentUser = Meteor.user();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
|
|
@ -140,12 +140,6 @@ Template.invitePeoplePopup.events({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.invitePeoplePopup.helpers({
|
|
||||||
currentSetting() {
|
|
||||||
return Settings.findOne();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
Template.editProfilePopup.helpers({
|
Template.editProfilePopup.helpers({
|
||||||
allowEmailChange() {
|
allowEmailChange() {
|
||||||
Meteor.call('AccountSettings.allowEmailChange', (_, result) => {
|
Meteor.call('AccountSettings.allowEmailChange', (_, result) => {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ Blaze.registerHelper('currentList', () => {
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Blaze.registerHelper('currentSetting', () => {
|
||||||
|
const ret = Utils.getCurrentSetting();
|
||||||
|
return ret;
|
||||||
|
});
|
||||||
|
|
||||||
Blaze.registerHelper('getUser', userId => Users.findOne(userId));
|
Blaze.registerHelper('getUser', userId => Users.findOne(userId));
|
||||||
|
|
||||||
Blaze.registerHelper('concat', (...args) => args.slice(0, -1).join(''));
|
Blaze.registerHelper('concat', (...args) => args.slice(0, -1).join(''));
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,13 @@ Meteor.subscribe('setting');
|
||||||
import { ALLOWED_WAIT_SPINNERS } from '/config/const';
|
import { ALLOWED_WAIT_SPINNERS } from '/config/const';
|
||||||
|
|
||||||
export class Spinner extends BlazeComponent {
|
export class Spinner extends BlazeComponent {
|
||||||
currentSettings() {
|
|
||||||
return Settings.findOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
getSpinnerName() {
|
getSpinnerName() {
|
||||||
let ret = 'Bounce';
|
let ret = 'Bounce';
|
||||||
let defaultWaitSpinner = Meteor.settings.public.WAIT_SPINNER;
|
let defaultWaitSpinner = Meteor.settings.public.WAIT_SPINNER;
|
||||||
if (defaultWaitSpinner && ALLOWED_WAIT_SPINNERS.includes(defaultWaitSpinner)) {
|
if (defaultWaitSpinner && ALLOWED_WAIT_SPINNERS.includes(defaultWaitSpinner)) {
|
||||||
ret = defaultWaitSpinner;
|
ret = defaultWaitSpinner;
|
||||||
}
|
}
|
||||||
let settings = this.currentSettings();
|
let settings = Utils.getCurrentSetting();
|
||||||
|
|
||||||
if (settings && settings.spinnerName) {
|
if (settings && settings.spinnerName) {
|
||||||
ret = settings.spinnerName;
|
ret = settings.spinnerName;
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,10 @@ Utils = {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getCurrentSetting() {
|
||||||
|
const ret = ReactiveCache.getCurrentSetting();
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
getPopupCard() {
|
getPopupCard() {
|
||||||
const cardId = Utils.getPopupCardId();
|
const cardId = Utils.getPopupCardId();
|
||||||
const ret = ReactiveCache.getCard(cardId);
|
const ret = ReactiveCache.getCard(cardId);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ ReactiveCacheServer = {
|
||||||
const ret = CustomFields.find(selector).fetch();
|
const ret = CustomFields.find(selector).fetch();
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getCurrentSetting() {
|
||||||
|
const ret = Settings.findOne();
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// only the Client is reactive
|
// only the Client is reactive
|
||||||
|
|
@ -106,6 +110,16 @@ ReactiveCacheClient = {
|
||||||
}
|
}
|
||||||
const ret = this.__customFields.get(Jsons.stringify(selector));
|
const ret = this.__customFields.get(Jsons.stringify(selector));
|
||||||
return ret;
|
return ret;
|
||||||
|
},
|
||||||
|
getCurrentSetting() {
|
||||||
|
if (!this.__currentSetting || !this.__currentSetting.get()) {
|
||||||
|
this.__currentSetting = new DataCache(() => {
|
||||||
|
const _ret = Settings.findOne();
|
||||||
|
return _ret;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const ret = this.__currentSetting.get();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,6 +193,15 @@ ReactiveCache = {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
getCurrentSetting() {
|
||||||
|
let ret;
|
||||||
|
if (Meteor.isServer) {
|
||||||
|
ret = ReactiveCacheServer.getCurrentSetting();
|
||||||
|
} else {
|
||||||
|
ret = ReactiveCacheClient.getCurrentSetting();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ReactiveCache };
|
export { ReactiveCache };
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { ReactiveCache } from '/imports/reactiveCache';
|
||||||
import { TAPi18n } from '/imports/i18n';
|
import { TAPi18n } from '/imports/i18n';
|
||||||
//var nodemailer = require('nodemailer');
|
//var nodemailer = require('nodemailer');
|
||||||
|
|
||||||
|
|
@ -167,7 +168,7 @@ Settings.allow({
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
Settings._collection.createIndex({ modifiedAt: -1 });
|
Settings._collection.createIndex({ modifiedAt: -1 });
|
||||||
const setting = Settings.findOne({});
|
const setting = ReactiveCache.getCurrentSetting();
|
||||||
if (!setting) {
|
if (!setting) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const domain = process.env.ROOT_URL.match(
|
const domain = process.env.ROOT_URL.match(
|
||||||
|
|
@ -193,7 +194,7 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
if (isSandstorm) {
|
if (isSandstorm) {
|
||||||
// At Sandstorm, Admin Panel has SMTP settings
|
// At Sandstorm, Admin Panel has SMTP settings
|
||||||
const newSetting = Settings.findOne();
|
const newSetting = ReactiveCache.getCurrentSetting();
|
||||||
if (!process.env.MAIL_URL && newSetting.mailUrl())
|
if (!process.env.MAIL_URL && newSetting.mailUrl())
|
||||||
process.env.MAIL_URL = newSetting.mailUrl();
|
process.env.MAIL_URL = newSetting.mailUrl();
|
||||||
Accounts.emailTemplates.from = process.env.MAIL_FROM
|
Accounts.emailTemplates.from = process.env.MAIL_FROM
|
||||||
|
|
@ -301,7 +302,7 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNonAdminAllowedToSendMail(currentUser){
|
function isNonAdminAllowedToSendMail(currentUser){
|
||||||
const currSett = Settings.findOne({});
|
const currSett = ReactiveCache.getCurrentSetting();
|
||||||
let isAllowed = false;
|
let isAllowed = false;
|
||||||
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
||||||
for(let i = 0; i < currentUser.emails.length; i++) {
|
for(let i = 0; i < currentUser.emails.length; i++) {
|
||||||
|
|
@ -449,7 +450,7 @@ if (Meteor.isServer) {
|
||||||
},
|
},
|
||||||
|
|
||||||
getCustomUI() {
|
getCustomUI() {
|
||||||
const setting = Settings.findOne({});
|
const setting = ReactiveCache.getCurrentSetting();
|
||||||
if (!setting.productName) {
|
if (!setting.productName) {
|
||||||
return {
|
return {
|
||||||
productName: '',
|
productName: '',
|
||||||
|
|
@ -462,7 +463,7 @@ if (Meteor.isServer) {
|
||||||
},
|
},
|
||||||
|
|
||||||
isDisableRegistration() {
|
isDisableRegistration() {
|
||||||
const setting = Settings.findOne({});
|
const setting = ReactiveCache.getCurrentSetting();
|
||||||
if (setting.disableRegistration === true) {
|
if (setting.disableRegistration === true) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -471,7 +472,7 @@ if (Meteor.isServer) {
|
||||||
},
|
},
|
||||||
|
|
||||||
isDisableForgotPassword() {
|
isDisableForgotPassword() {
|
||||||
const setting = Settings.findOne({});
|
const setting = ReactiveCache.getCurrentSetting();
|
||||||
if (setting.disableForgotPassword === true) {
|
if (setting.disableForgotPassword === true) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
//var nodemailer = require('nodemailer');
|
import { ReactiveCache } from '/imports/reactiveCache';
|
||||||
import { SyncedCron } from 'meteor/percolate:synced-cron';
|
import { SyncedCron } from 'meteor/percolate:synced-cron';
|
||||||
import { TAPi18n } from '/imports/i18n';
|
import { TAPi18n } from '/imports/i18n';
|
||||||
import ImpersonatedUsers from './impersonatedUsers';
|
import ImpersonatedUsers from './impersonatedUsers';
|
||||||
|
|
@ -1425,11 +1425,7 @@ if (Meteor.isServer) {
|
||||||
throw new Meteor.Error('error-user-notAllowSelf');
|
throw new Meteor.Error('error-user-notAllowSelf');
|
||||||
} else {
|
} else {
|
||||||
if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist');
|
if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist');
|
||||||
if (
|
if (ReactiveCache.getCurrentSetting().disableRegistration) {
|
||||||
Settings.findOne({
|
|
||||||
disableRegistration: true,
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
throw new Meteor.Error('error-user-notCreated');
|
throw new Meteor.Error('error-user-notCreated');
|
||||||
}
|
}
|
||||||
// Set in lowercase email before creating account
|
// Set in lowercase email before creating account
|
||||||
|
|
@ -1667,7 +1663,7 @@ if (Meteor.isServer) {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
const disableRegistration = Settings.findOne().disableRegistration;
|
const disableRegistration = ReactiveCache.getCurrentSetting().disableRegistration;
|
||||||
// If this is the first Authentication by the ldap and self registration disabled
|
// If this is the first Authentication by the ldap and self registration disabled
|
||||||
if (disableRegistration && options && options.ldap) {
|
if (disableRegistration && options && options.ldap) {
|
||||||
user.authenticationMethod = 'ldap';
|
user.authenticationMethod = 'ldap';
|
||||||
|
|
@ -1972,7 +1968,7 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//invite user to corresponding boards
|
//invite user to corresponding boards
|
||||||
const disableRegistration = Settings.findOne().disableRegistration;
|
const disableRegistration = Utils.getCurrentSetting().disableRegistration;
|
||||||
// If ldap, bypass the inviation code if the self registration isn't allowed.
|
// If ldap, bypass the inviation code if the self registration isn't allowed.
|
||||||
// TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type
|
// TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type
|
||||||
if (doc.authenticationMethod !== 'ldap' && disableRegistration) {
|
if (doc.authenticationMethod !== 'ldap' && disableRegistration) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue