From 1dfb6ef477dba4d0faf4bf86026647f43fb2f5f6 Mon Sep 17 00:00:00 2001 From: lkisme Date: Fri, 24 Feb 2017 22:10:38 +0800 Subject: Admin panel: Only invited user can register in strict mode, Set mail server in admin panel, Switch strict mode in admin panel, Invite people to system in admin panel --- config/accounts.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'config/accounts.js') diff --git a/config/accounts.js b/config/accounts.js index 9ab26b33..51c0f49e 100644 --- a/config/accounts.js +++ b/config/accounts.js @@ -1,12 +1,21 @@ const passwordField = AccountsTemplates.removeField('password'); const emailField = AccountsTemplates.removeField('email'); + AccountsTemplates.addFields([{ _id: 'username', type: 'text', displayName: 'username', required: true, minLength: 2, -}, emailField, passwordField]); +}, emailField, passwordField, { + _id: 'invitationcode', + type: 'text', + displayName: 'Invitation Code', + required: false, + minLength: 6, + errStr: 'Invitation code doesn\'t exist', + template: 'invitationCode', +}]); AccountsTemplates.configure({ defaultLayout: 'userFormsLayout', @@ -48,9 +57,6 @@ AccountsTemplates.configureRoute('changePwd', { }); if (Meteor.isServer) { - if (process.env.MAIL_FROM) { - Accounts.emailTemplates.from = process.env.MAIL_FROM; - } ['resetPassword-subject', 'resetPassword-text', 'verifyEmail-subject', 'verifyEmail-text', 'enrollAccount-subject', 'enrollAccount-text'].forEach((str) => { const [templateName, field] = str.split('-'); @@ -63,3 +69,4 @@ if (Meteor.isServer) { }; }); } + -- cgit v1.2.3-1-g7c22