Bugfix: Could not login when the CROWD disabled and LDAP enabled (#3974)

pull/3976/head
Maki Nishifuji 10 years ago committed by Rodrigo Nascimento
parent bc5ce36fe8
commit 6ca77c26c5
  1. 1
      .meteor/versions
  2. 3
      packages/rocketchat-crowd/client/loginHelper.js
  3. 10
      packages/rocketchat-crowd/server/crowd.js
  4. 1
      packages/rocketchat-ldap/client/loginHelper.js
  5. 9
      packages/rocketchat-ldap/server/loginHandler.js

@ -74,7 +74,6 @@ livedata@1.0.15
localstorage@1.0.5
logging@1.0.8
matb33:collection-hooks@0.8.1
mdg:geolocation@1.3.0
mdg:validation-error@0.5.1
meteor@1.1.10
meteor-base@1.0.1

@ -8,6 +8,7 @@ Meteor.loginWithCrowd = function(username, password, callback) {
username = args.shift();
password = args.shift();
var loginRequest = {
crowd: true,
username: username,
crowdPassword: password
};
@ -23,4 +24,4 @@ Meteor.loginWithCrowd = function(username, password, callback) {
}
}
});
};
};

@ -180,6 +180,16 @@ const CROWD = class CROWD {
};
Accounts.registerLoginHandler('crowd', function(loginRequest) {
if (!loginRequest.crowd) {
return undefined;
}
logger.info('Init CROWD login', loginRequest.username);
if (RocketChat.settings.get('CROWD_Enable') !== true) {
return fallbackDefaultAccountSystem(this, loginRequest.username, loginRequest.crowdPassword);
}
const crowd = new CROWD();
let user;
try {

@ -29,6 +29,7 @@ Meteor.loginWithLDAP = function(username, password, customLdapOptions, callback)
// Set up loginRequest object
var loginRequest = {
ldap: true,
username: username,
ldapPass: password,
ldapOptions: customLdapOptions

@ -27,18 +27,17 @@ function fallbackDefaultAccountSystem(bind, username, password) {
Accounts.registerLoginHandler('ldap', function(loginRequest) {
const self = this;
if (!loginRequest.ldapOptions) {
if (!loginRequest.ldap || !loginRequest.ldapOptions) {
return undefined;
}
logger.info('Init login', loginRequest.username);
logger.info('Init LDAP login', loginRequest.username);
if (RocketChat.settings.get('LDAP_Enable') !== true) {
return fallbackDefaultAccountSystem(self, loginRequest.username, loginRequest.ldapPass);
return fallbackDefaultAccountSystem(this, loginRequest.username, loginRequest.ldapPass);
}
const self = this;
const ldap = new LDAP();
let ldapUser;

Loading…
Cancel
Save