summaryrefslogtreecommitdiffstats
path: root/client/components/settings
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-10-03 11:50:52 +0300
committerLauri Ojansivu <x@xet7.org>2018-10-03 11:50:52 +0300
commit288800eafc91d07f859c4f59588e0b646137ccb9 (patch)
tree063166a4d05c48bf388f6836defc930e37e4e97f /client/components/settings
parent18a1d4c5c63bb8264dee15432e3c4d88d54d51b1 (diff)
downloadwekan-288800eafc91d07f859c4f59588e0b646137ccb9.tar.gz
wekan-288800eafc91d07f859c4f59588e0b646137ccb9.tar.bz2
wekan-288800eafc91d07f859c4f59588e0b646137ccb9.zip
- Add LDAP. In progress.
Thanks to maximest-pierre, Akuket and xet. Related #119
Diffstat (limited to 'client/components/settings')
-rw-r--r--client/components/settings/connectionMethod.jade6
-rw-r--r--client/components/settings/connectionMethod.js34
2 files changed, 40 insertions, 0 deletions
diff --git a/client/components/settings/connectionMethod.jade b/client/components/settings/connectionMethod.jade
new file mode 100644
index 00000000..598dd9dd
--- /dev/null
+++ b/client/components/settings/connectionMethod.jade
@@ -0,0 +1,6 @@
+template(name='connectionMethod')
+ div.at-form-connection
+ label Authentication method
+ select.select-connection
+ each connections
+ option(value="{{value}}") {{_ value}}
diff --git a/client/components/settings/connectionMethod.js b/client/components/settings/connectionMethod.js
new file mode 100644
index 00000000..4983a3ef
--- /dev/null
+++ b/client/components/settings/connectionMethod.js
@@ -0,0 +1,34 @@
+Template.connectionMethod.onCreated(function() {
+ this.connectionMethods = new ReactiveVar([]);
+
+ Meteor.call('getConnectionsEnabled', (_, result) => {
+ if (result) {
+ // TODO : add a management of different languages
+ // (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')})
+ this.connectionMethods.set([
+ {value: 'default'},
+ // Gets only the connection methods availables
+ ...Object.entries(result).filter((e) => e[1]).map((e) => ({value: e[0]})),
+ ]);
+ }
+
+ // If only the default authentication available, hides the select boxe
+ const content = $('.at-form-connection');
+ if (!(this.connectionMethods.get().length > 1)) {
+ content.hide();
+ } else {
+ content.show();
+ }
+ });
+});
+
+Template.connectionMethod.onRendered(() => {
+ // Moves the select boxe in the first place of the at-pwd-form div
+ $('.at-form-connection').detach().prependTo('.at-pwd-form');
+});
+
+Template.connectionMethod.helpers({
+ connections() {
+ return Template.instance().connectionMethods.get();
+ },
+});