summaryrefslogtreecommitdiffstats
path: root/client/components/settings/peopleBody.js
diff options
context:
space:
mode:
authorguillaume <guillaume.cassou@supinfo.com>2018-10-09 14:14:39 +0200
committerguillaume <guillaume.cassou@supinfo.com>2018-10-09 14:14:39 +0200
commit3b4f285fea4a90ee96bfce855e1539adcec9b7aa (patch)
tree61cbf1212c8d4052cf2bd3c37a497f1d8b204140 /client/components/settings/peopleBody.js
parent5b8c642d8fb16e00000a1d92bcd3a5c6bbd07bce (diff)
downloadwekan-3b4f285fea4a90ee96bfce855e1539adcec9b7aa.tar.gz
wekan-3b4f285fea4a90ee96bfce855e1539adcec9b7aa.tar.bz2
wekan-3b4f285fea4a90ee96bfce855e1539adcec9b7aa.zip
add ldap support | simplify authentications
Diffstat (limited to 'client/components/settings/peopleBody.js')
-rw-r--r--client/components/settings/peopleBody.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js
index 7cc992f2..acc94081 100644
--- a/client/components/settings/peopleBody.js
+++ b/client/components/settings/peopleBody.js
@@ -62,10 +62,39 @@ Template.peopleRow.helpers({
},
});
+Template.editUserPopup.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.editUserPopup.helpers({
user() {
return Users.findOne(this.userId);
},
+ authentications() {
+ return Template.instance().authenticationMethods.get();
+ },
+ isSelected(match) {
+ const userId = Template.instance().data.userId;
+ const selected = Users.findOne(userId).authenticationMethod;
+ return selected === match;
+ },
+ isLdap() {
+ const userId = Template.instance().data.userId;
+ const selected = Users.findOne(userId).authenticationMethod;
+ return selected === 'ldap';
+ }
});
BlazeComponent.extendComponent({
@@ -91,6 +120,7 @@ Template.editUserPopup.events({
const isAdmin = tpl.find('.js-profile-isadmin').value.trim();
const isActive = tpl.find('.js-profile-isactive').value.trim();
const email = tpl.find('.js-profile-email').value.trim();
+ const authentication = tpl.find('.js-authenticationMethod').value.trim();
const isChangePassword = password.length > 0;
const isChangeUserName = username !== user.username;
@@ -101,6 +131,7 @@ Template.editUserPopup.events({
'profile.fullname': fullname,
'isAdmin': isAdmin === 'true',
'loginDisabled': isActive === 'true',
+ 'authenticationMethod': authentication
},
});