mirror of
https://github.com/wekan/wekan.git
synced 2026-02-08 17:34:19 +01:00
- Add LDAP. In progress.
Thanks to maximest-pierre, Akuket and xet. Related #119
This commit is contained in:
parent
18a1d4c5c6
commit
288800eafc
9 changed files with 139 additions and 4 deletions
|
|
@ -127,6 +127,11 @@ Users.attachSchema(new SimpleSchema({
|
|||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
// TODO : write a migration and check if using a ldap parameter is better than a connection_type parameter
|
||||
ldap: {
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
}));
|
||||
|
||||
Users.allow({
|
||||
|
|
@ -490,7 +495,6 @@ if (Meteor.isServer) {
|
|||
|
||||
if (user.services.oidc) {
|
||||
const email = user.services.oidc.email.toLowerCase();
|
||||
|
||||
user.username = user.services.oidc.username;
|
||||
user.emails = [{ address: email, verified: true }];
|
||||
const initials = user.services.oidc.fullname.match(/\b[a-zA-Z]/g).join('').toUpperCase();
|
||||
|
|
@ -518,7 +522,10 @@ if (Meteor.isServer) {
|
|||
}
|
||||
|
||||
const disableRegistration = Settings.findOne().disableRegistration;
|
||||
if (!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.ldap = true;
|
||||
return user;
|
||||
}
|
||||
|
||||
|
|
@ -636,7 +643,9 @@ if (Meteor.isServer) {
|
|||
|
||||
//invite user to corresponding boards
|
||||
const disableRegistration = Settings.findOne().disableRegistration;
|
||||
if (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 (!doc.ldap && disableRegistration) {
|
||||
const invitationCode = InvitationCodes.findOne({code: doc.profile.icode, valid: true});
|
||||
if (!invitationCode) {
|
||||
throw new Meteor.Error('error-invitation-code-not-exist');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue