From df54f15ecb36e105ad2116443672c99d52569958 Mon Sep 17 00:00:00 2001 From: guillaume Date: Mon, 16 Jul 2018 19:20:47 +0200 Subject: patch re-invit --- client/components/settings/settingBody.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 7230d893..ff563fc1 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -82,6 +82,7 @@ BlazeComponent.extendComponent({ }, inviteThroughEmail() { + /* eslint-disable no-console */ const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(','); const boardsToInvite = []; $('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () { @@ -99,9 +100,11 @@ BlazeComponent.extendComponent({ // if (!err) { // TODO - show more info to user // } + this.setLoading(false); }); } + /* eslint-enable no-console */ }, saveMailServerInfo() { -- cgit v1.2.3-1-g7c22 From bf5596b20182628a6a9285c86a239b1f61b96fdf Mon Sep 17 00:00:00 2001 From: Akuket <32392661+Akuket@users.noreply.github.com> Date: Tue, 17 Jul 2018 16:07:46 +0200 Subject: patch re invit --- client/components/settings/settingBody.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index ff563fc1..6a69fcb6 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -82,7 +82,6 @@ BlazeComponent.extendComponent({ }, inviteThroughEmail() { - /* eslint-disable no-console */ const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(','); const boardsToInvite = []; $('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () { @@ -104,7 +103,6 @@ BlazeComponent.extendComponent({ this.setLoading(false); }); } - /* eslint-enable no-console */ }, saveMailServerInfo() { -- cgit v1.2.3-1-g7c22 From a8f41f7994b0c3a43aa4b82be06d35911eacab4d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 18 Jul 2018 00:46:45 +0300 Subject: Remove SMTP settings from Admin Panel, because they are set in environment variable settings like source/snap/docker already, and password was exposed in plain text. Thanks to xet7 ! Closes #1783 --- client/components/settings/settingBody.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 7230d893..5995cbf1 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -20,7 +20,7 @@ BlazeComponent.extendComponent({ setLoading(w) { this.loading.set(w); }, - + /* checkField(selector) { const value = $(selector).val(); if (!value || value.trim() === '') { @@ -30,7 +30,7 @@ BlazeComponent.extendComponent({ return value; } }, - +*/ currentSetting() { return Settings.findOne(); }, @@ -55,9 +55,11 @@ BlazeComponent.extendComponent({ $('.invite-people').slideDown(); } }, + /* toggleTLS() { $('#mail-server-tls').toggleClass('is-checked'); }, +*/ switchMenu(event) { const target = $(event.target); if (!target.hasClass('active')) { @@ -104,6 +106,7 @@ BlazeComponent.extendComponent({ } }, + /* saveMailServerInfo() { this.setLoading(true); $('li').removeClass('has-error'); @@ -128,7 +131,7 @@ BlazeComponent.extendComponent({ } }, - +*/ sendSMTPTestEmail() { Meteor.call('sendSMTPTestEmail', (err, ret) => { if (!err && ret) { /* eslint-disable no-console */ @@ -148,11 +151,15 @@ BlazeComponent.extendComponent({ events() { return [{ 'click a.js-toggle-registration': this.toggleRegistration, + /* 'click a.js-toggle-tls': this.toggleTLS, +*/ 'click a.js-setting-menu': this.switchMenu, 'click a.js-toggle-board-choose': this.checkBoard, 'click button.js-email-invite': this.inviteThroughEmail, + /* 'click button.js-save': this.saveMailServerInfo, +*/ 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, }]; }, -- cgit v1.2.3-1-g7c22 From b216c63c132e587e590e5faa0285ca5ca2641765 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 20 Aug 2018 23:16:24 +0300 Subject: - Restored SMTP settings at Admin Panel, and disabled showing password. Thanks to xet7 ! Closes #1790 --- client/components/settings/settingBody.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index de96c100..7230d893 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -20,7 +20,7 @@ BlazeComponent.extendComponent({ setLoading(w) { this.loading.set(w); }, - /* + checkField(selector) { const value = $(selector).val(); if (!value || value.trim() === '') { @@ -30,7 +30,7 @@ BlazeComponent.extendComponent({ return value; } }, -*/ + currentSetting() { return Settings.findOne(); }, @@ -55,11 +55,9 @@ BlazeComponent.extendComponent({ $('.invite-people').slideDown(); } }, - /* toggleTLS() { $('#mail-server-tls').toggleClass('is-checked'); }, -*/ switchMenu(event) { const target = $(event.target); if (!target.hasClass('active')) { @@ -101,13 +99,11 @@ BlazeComponent.extendComponent({ // if (!err) { // TODO - show more info to user // } - this.setLoading(false); }); } }, - /* saveMailServerInfo() { this.setLoading(true); $('li').removeClass('has-error'); @@ -132,7 +128,7 @@ BlazeComponent.extendComponent({ } }, -*/ + sendSMTPTestEmail() { Meteor.call('sendSMTPTestEmail', (err, ret) => { if (!err && ret) { /* eslint-disable no-console */ @@ -152,15 +148,11 @@ BlazeComponent.extendComponent({ events() { return [{ 'click a.js-toggle-registration': this.toggleRegistration, - /* 'click a.js-toggle-tls': this.toggleTLS, -*/ 'click a.js-setting-menu': this.switchMenu, 'click a.js-toggle-board-choose': this.checkBoard, 'click button.js-email-invite': this.inviteThroughEmail, - /* 'click button.js-save': this.saveMailServerInfo, -*/ 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, }]; }, -- cgit v1.2.3-1-g7c22 From 4cb25a5bcf5263f9c803a0a1d4ceaf6a9e5db75f Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 24 Oct 2018 11:39:45 +0300 Subject: - Custom Product Name in Admin Panel / Layout. In Progress, setting does not affect change UI yet. Thanks to xet7 ! - Fix LDAP User Search Scope. Thanks to Vnimos and Akuket ! Related #119 - Fix Save Admin Panel STMP password. Thanks to saurabharch and xet7 ! Closes #1856 --- client/components/settings/settingBody.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 7230d893..0ff4f99c 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -6,6 +6,7 @@ BlazeComponent.extendComponent({ this.emailSetting = new ReactiveVar(false); this.accountSetting = new ReactiveVar(false); this.announcementSetting = new ReactiveVar(false); + this.layoutSetting = new ReactiveVar(false); Meteor.subscribe('setting'); Meteor.subscribe('mailServer'); @@ -68,6 +69,7 @@ BlazeComponent.extendComponent({ this.emailSetting.set('email-setting' === targetID); this.accountSetting.set('account-setting' === targetID); this.announcementSetting.set('announcement-setting' === targetID); + this.layoutSetting.set('layout-setting' === targetID); } }, @@ -129,6 +131,25 @@ BlazeComponent.extendComponent({ }, + saveLayout() { + this.setLoading(true); + $('li').removeClass('has-error'); + + try { + const productName = $('#product-name').val().trim(); + Settings.update(Settings.findOne()._id, { + $set: { + 'productName': productName, + }, + }); + } catch (e) { + return; + } finally { + this.setLoading(false); + } + + }, + sendSMTPTestEmail() { Meteor.call('sendSMTPTestEmail', (err, ret) => { if (!err && ret) { /* eslint-disable no-console */ @@ -154,6 +175,7 @@ BlazeComponent.extendComponent({ 'click button.js-email-invite': this.inviteThroughEmail, 'click button.js-save': this.saveMailServerInfo, 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, + 'click button.js-save-layout': this.saveLayout, }]; }, }).register('setting'); -- cgit v1.2.3-1-g7c22 From 90a0478d0b7ada2347e3a2f4c211507427a1673e Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 24 Oct 2018 12:13:20 +0300 Subject: - Fix lint error. Thanks to xet7 ! --- client/components/settings/settingBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 0ff4f99c..4ad65400 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -139,7 +139,7 @@ BlazeComponent.extendComponent({ const productName = $('#product-name').val().trim(); Settings.update(Settings.findOne()._id, { $set: { - 'productName': productName, + productName, }, }); } catch (e) { -- cgit v1.2.3-1-g7c22 From dd6ba152a0b38950f82ec98fbe51fb746c402615 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 20 Nov 2018 02:38:00 +0200 Subject: Admin Panel / Layout: Hide Logo: Yes / No. This does hide Wekan logo on Login page and Board page. Thanks to xet7. --- client/components/settings/settingBody.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 4ad65400..5bebc8d0 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -59,6 +59,9 @@ BlazeComponent.extendComponent({ toggleTLS() { $('#mail-server-tls').toggleClass('is-checked'); }, + toggleHideLogo() { + $('#hide-logo').toggleClass('is-checked'); + }, switchMenu(event) { const target = $(event.target); if (!target.hasClass('active')) { @@ -135,11 +138,15 @@ BlazeComponent.extendComponent({ this.setLoading(true); $('li').removeClass('has-error'); + const productName = $('#product-name').val().trim(); + const hideLogoChange = ($('input[name=hideLogo]:checked').val() === 'true'); + try { - const productName = $('#product-name').val().trim(); + Settings.update(Settings.findOne()._id, { $set: { productName, + hideLogo: hideLogoChange, }, }); } catch (e) { @@ -175,6 +182,7 @@ BlazeComponent.extendComponent({ 'click button.js-email-invite': this.inviteThroughEmail, 'click button.js-save': this.saveMailServerInfo, 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, + 'click a.js-toggle-hide-logo': this.toggleHideLogo, 'click button.js-save-layout': this.saveLayout, }]; }, -- cgit v1.2.3-1-g7c22 From f0232fb5cb0f2a890f346f2a0e7277c826244266 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 20 Nov 2018 11:35:14 +0200 Subject: - Fix: When saving Admin Panel / Layout, save also SMTP settings. Thanks to xet7 ! --- client/components/settings/settingBody.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 5bebc8d0..ddb4cd0f 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -155,6 +155,8 @@ BlazeComponent.extendComponent({ this.setLoading(false); } + saveMailServerInfo(); + }, sendSMTPTestEmail() { -- cgit v1.2.3-1-g7c22 From dbb1a86ca377e551063cc04c5189fad4aa9148c0 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 15 Dec 2018 20:39:01 +0200 Subject: - Admin Panel / Layout / Custom Product Name now changes webpage title. Thanks to xet7 ! Related #1196 --- client/components/settings/settingBody.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index ddb4cd0f..3f6f36f4 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -155,6 +155,8 @@ BlazeComponent.extendComponent({ this.setLoading(false); } + DocHead.setTitle(productName); + saveMailServerInfo(); }, -- cgit v1.2.3-1-g7c22 From ab031d9da134aa13490a26dbe97ad2d7d01d534a Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 15 Dec 2018 21:55:20 +0200 Subject: - Remove not working duplicate saveMailServerInfo, to remove error from browser dev tools console. Thanks to xet7 ! --- client/components/settings/settingBody.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 3f6f36f4..ba5b4f47 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -157,8 +157,6 @@ BlazeComponent.extendComponent({ DocHead.setTitle(productName); - saveMailServerInfo(); - }, sendSMTPTestEmail() { -- cgit v1.2.3-1-g7c22 From f1ed6304a4c3bfcd1c778b0c43cafe6808829286 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 16 Dec 2018 22:21:16 +0200 Subject: - Admin Panel / Layout / Custom HTML after start, and Custom HTML before end. In progress, does not work yet. Thanks to xet7 ! --- client/components/settings/settingBody.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index ba5b4f47..4f07c84c 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -140,6 +140,8 @@ BlazeComponent.extendComponent({ const productName = $('#product-name').val().trim(); const hideLogoChange = ($('input[name=hideLogo]:checked').val() === 'true'); + const customHTMLafterBodyStart = $('#customHTMLafterBodyStart').val().trim(); + const customHTMLbeforeBodyEnd = $('#customHTMLbeforeBodyEnd').val().trim(); try { @@ -147,6 +149,8 @@ BlazeComponent.extendComponent({ $set: { productName, hideLogo: hideLogoChange, + customHTMLafterBodyStart, + customHTMLbeforeBodyEnd, }, }); } catch (e) { -- cgit v1.2.3-1-g7c22 From c2118f4830020631ab228c59c8b9247a13655ae6 Mon Sep 17 00:00:00 2001 From: guillaume Date: Fri, 1 Feb 2019 19:00:44 +0100 Subject: Improve authentication --- client/components/settings/settingBody.js | 37 ++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 4f07c84c..1d05a8c7 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -62,6 +62,9 @@ BlazeComponent.extendComponent({ toggleHideLogo() { $('#hide-logo').toggleClass('is-checked'); }, + toggleDisplayAuthenticationMethod() { + $('#display-authentication-method').toggleClass('is-checked'); + }, switchMenu(event) { const target = $(event.target); if (!target.hasClass('active')) { @@ -140,17 +143,20 @@ BlazeComponent.extendComponent({ const productName = $('#product-name').val().trim(); const hideLogoChange = ($('input[name=hideLogo]:checked').val() === 'true'); + const displayAuthenticationMethod = ($('input[name=displayAuthenticationMethod]:checked').val() === 'true'); + const defaultAuthenticationMethod = $('#defaultAuthenticationMethod').val(); const customHTMLafterBodyStart = $('#customHTMLafterBodyStart').val().trim(); const customHTMLbeforeBodyEnd = $('#customHTMLbeforeBodyEnd').val().trim(); try { - Settings.update(Settings.findOne()._id, { $set: { productName, hideLogo: hideLogoChange, customHTMLafterBodyStart, customHTMLbeforeBodyEnd, + displayAuthenticationMethod, + defaultAuthenticationMethod }, }); } catch (e) { @@ -190,6 +196,7 @@ BlazeComponent.extendComponent({ 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, 'click a.js-toggle-hide-logo': this.toggleHideLogo, 'click button.js-save-layout': this.saveLayout, + 'click a.js-toggle-display-authentication-method': this.toggleDisplayAuthenticationMethod }]; }, }).register('setting'); @@ -262,3 +269,31 @@ BlazeComponent.extendComponent({ }]; }, }).register('announcementSettings'); + + +Template.selectAuthenticationMethod.onCreated(function() { + this.authenticationMethods = new ReactiveVar([]); + + Meteor.call('getAuthenticationsEnabled', (_, result) => { + if (result) { + // TODO : add a management of different languages + // (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')}) + this.authenticationMethods.set([ + {value: 'password'}, + // Gets only the authentication methods availables + ...Object.entries(result).filter((e) => e[1]).map((e) => ({value: e[0]})), + ]); + } + }); +}); + +Template.selectAuthenticationMethod.helpers({ + authentications() { + return Template.instance().authenticationMethods.get(); + }, + isSelected(match) { + console.log('this : ', this); + console.log('instance : ', Template.instance()); + return Template.instance().data.authenticationMethod === match; + } +}); \ No newline at end of file -- cgit v1.2.3-1-g7c22 From de9965213ae32f4c314dd1a791891e01d12da1dd Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 1 Feb 2019 21:26:04 +0200 Subject: - Fix lint errors. Thanks to xet7 ! --- client/components/settings/settingBody.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 1d05a8c7..2f58d551 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -156,7 +156,7 @@ BlazeComponent.extendComponent({ customHTMLafterBodyStart, customHTMLbeforeBodyEnd, displayAuthenticationMethod, - defaultAuthenticationMethod + defaultAuthenticationMethod, }, }); } catch (e) { @@ -171,17 +171,14 @@ BlazeComponent.extendComponent({ sendSMTPTestEmail() { Meteor.call('sendSMTPTestEmail', (err, ret) => { - if (!err && ret) { /* eslint-disable no-console */ + if (!err && ret) { const message = `${TAPi18n.__(ret.message)}: ${ret.email}`; - console.log(message); alert(message); } else { const reason = err.reason || ''; const message = `${TAPi18n.__(err.error)}\n${reason}`; - console.log(message, err); alert(message); } - /* eslint-enable no-console */ }); }, @@ -196,7 +193,7 @@ BlazeComponent.extendComponent({ 'click button.js-send-smtp-test-email': this.sendSMTPTestEmail, 'click a.js-toggle-hide-logo': this.toggleHideLogo, 'click button.js-save-layout': this.saveLayout, - 'click a.js-toggle-display-authentication-method': this.toggleDisplayAuthenticationMethod + 'click a.js-toggle-display-authentication-method': this.toggleDisplayAuthenticationMethod, }]; }, }).register('setting'); @@ -292,8 +289,6 @@ Template.selectAuthenticationMethod.helpers({ return Template.instance().authenticationMethods.get(); }, isSelected(match) { - console.log('this : ', this); - console.log('instance : ', Template.instance()); return Template.instance().data.authenticationMethod === match; - } -}); \ No newline at end of file + }, +}); -- cgit v1.2.3-1-g7c22 From 40a3267615d34b011acbf19d6706a85d98e2e8fb Mon Sep 17 00:00:00 2001 From: Ole Langbehn Date: Sat, 16 Mar 2019 14:25:04 +0100 Subject: make emails for invitations all lowercase for compatibility with AccountsTemplates Email addresses for invitations are stored case sensitive in mongo, together with the invitation codes. When someone tries to sign up due to an invitation, in the sign up form, due to AccountsTemplates defaults, the email address is lowercased on blur of the textbox. When they then try to sign in, they get an error about the invitation code not existing. This makes it impossible to successfully invite people using non-lowercased email addresses. This patch lowercases the emails on the client side when inviting them. Other possibilities would be to lowercase them on the server side before storing them to mongodb, making a case insensitive search on mongodb, or making the email input field in the sign up form not lowercase the email string. This patch was chosen in favor of the other possibilities because of its simplicity. --- client/components/settings/settingBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 2f58d551..8279a092 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -90,7 +90,7 @@ BlazeComponent.extendComponent({ }, inviteThroughEmail() { - const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(','); + const emails = $('#email-to-invite').val().toLowerCase().trim().split('\n').join(',').split(','); const boardsToInvite = []; $('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () { boardsToInvite.push($(this).data('id')); -- cgit v1.2.3-1-g7c22