|
@@ -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 {
|