zahmis 5 anni fa
parent
commit
1a66ef6594
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      src/server/models/user.js

+ 7 - 2
src/server/models/user.js

@@ -41,7 +41,6 @@ module.exports = function(crowi) {
     imageUrlCached: String,
     isGravatarEnabled: { type: Boolean, default: false },
     isEmailPublished: { type: Boolean, default: true },
-    isEmailPublishedForNewUser: { type: Boolean, default: false },
     googleId: String,
     name: { type: String },
     username: { type: String, required: true, unique: true },
@@ -543,7 +542,6 @@ module.exports = function(crowi) {
     newUser.setPassword(password);
     newUser.createdAt = Date.now();
     newUser.status = STATUS_INVITED;
-    newUser.isEmailPublishedForNewUser = false;
 
     const globalLang = configManager.getConfig('crowi', 'app:globalLang');
     if (globalLang != null) {
@@ -653,6 +651,13 @@ module.exports = function(crowi) {
     }
 
     const configManager = crowi.configManager;
+
+    const isEmailPubshedForNewUser = configManager.getConfig('crowi', 'app:isEmailPubshedForNewUser');
+    if (isEmailPubshedForNewUser === false) {
+      newUser.isEmailPublished = false;
+    }
+
+
     const globalLang = configManager.getConfig('crowi', 'app:globalLang');
     if (globalLang != null) {
       newUser.lang = globalLang;