summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-12-02 23:30:10 +0200
committerLauri Ojansivu <x@xet7.org>2018-12-02 23:30:10 +0200
commit97158de70fff526b61cadf4c9819c74bd14c21d4 (patch)
tree97c2085945da7fd966f747ef1268ac671caf2671 /models
parent228996412c1324f4151c27ebbe172a94ce167eb9 (diff)
parent926faf00318fc6a6d2ebe2f8bf2c96537751407c (diff)
downloadwekan-97158de70fff526b61cadf4c9819c74bd14c21d4.tar.gz
wekan-97158de70fff526b61cadf4c9819c74bd14c21d4.tar.bz2
wekan-97158de70fff526b61cadf4c9819c74bd14c21d4.zip
Merge branch 'Akuket-devel' into edge
Diffstat (limited to 'models')
-rw-r--r--models/settings.js30
-rw-r--r--models/users.js8
2 files changed, 34 insertions, 4 deletions
diff --git a/models/settings.js b/models/settings.js
index 52212809..8d067c6d 100644
--- a/models/settings.js
+++ b/models/settings.js
@@ -239,5 +239,35 @@ if (Meteor.isServer) {
cas: isCasEnabled(),
};
},
+
+ getDefaultAuthenticationMethod() {
+ return process.env.DEFAULT_AUTHENTICATION_METHOD;
+ },
+
+ // TODO: patch error : did not check all arguments during call
+ logoutWithTimer(userId) {
+ if (process.env.LOGOUT_WITH_TIMER) {
+ Jobs.run('logOut', userId, {
+ in: {
+ days: process.env.LOGOUT_IN,
+ },
+ on: {
+ hour: process.env.LOGOUT_ON_HOURS,
+ minute: process.env.LOGOUT_ON_MINUTES,
+ },
+ priority: 1,
+ });
+ }
+ },
+ });
+
+ Jobs.register({
+ logOut(userId) {
+ Meteor.users.update(
+ {_id: userId},
+ {$set: {'services.resume.loginTokens': []}}
+ );
+ this.success();
+ },
});
}
diff --git a/models/users.js b/models/users.js
index 630f4703..2e879d94 100644
--- a/models/users.js
+++ b/models/users.js
@@ -520,10 +520,10 @@ if (Meteor.isServer) {
}
const disableRegistration = Settings.findOne().disableRegistration;
- // If ldap, bypass the inviation code if the self registration isn't allowed.
- // TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type
- if (options.ldap || !disableRegistration) {
- user.authenticationMethod = 'ldap';
+ if (!disableRegistration) {
+ if (options.ldap) {
+ user.authenticationMethod = 'ldap';
+ }
return user;
}