Skip to content

Commit

Permalink
Merge branch 'fix/omnichannel-transcript' of github.com:RocketChat/Ro…
Browse files Browse the repository at this point in the history
…cket.Chat into fix/omnichannel-transcript
  • Loading branch information
tiagoevanp committed Sep 17, 2021
2 parents 1510d66 + 47660fb commit eca8100
Show file tree
Hide file tree
Showing 157 changed files with 3,768 additions and 3,042 deletions.
2 changes: 1 addition & 1 deletion app/2fa/client/TOTPLDAP.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';

import { Utils2fa } from './lib/2fa';
import '../../ldap/client/loginHelper';
import '../../../client/startup/ldap';

Meteor.loginWithLDAPAndTOTP = function(...args) {
// Pull username and password
Expand Down
1 change: 1 addition & 0 deletions app/api/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import './v1/im';
import './v1/integrations';
import './v1/invites';
import './v1/import';
import './v1/ldap';
import './v1/misc';
import './v1/permissions';
import './v1/push';
Expand Down
33 changes: 33 additions & 0 deletions app/api/server/v1/ldap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { hasRole } from '../../../authorization/server';
import { settings } from '../../../settings/server';
import { API } from '../api';
import { SystemLogger } from '../../../../server/lib/logger/system';
import { LDAP } from '../../../../server/sdk';


API.v1.addRoute('ldap.testConnection', { authRequired: true }, {
post() {
if (!this.userId) {
throw new Error('error-invalid-user');
}

if (!hasRole(this.userId, 'admin')) {
throw new Error('error-not-authorized');
}

if (settings.get('LDAP_Enable') !== true) {
throw new Error('LDAP_disabled');
}

try {
Promise.await(LDAP.testConnection());
} catch (error) {
SystemLogger.error(error);
throw new Error('Connection_failed');
}

return API.v1.success({
message: 'Connection_success',
});
},
});
3 changes: 1 addition & 2 deletions app/importer-slack/server/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import _ from 'underscore';
import {
Base,
ProgressStep,
ImportData,
ImporterWebsocket,
} from '../../importer/server';
import { Messages } from '../../models';
import { Messages, ImportData } from '../../models/server';
import { settings } from '../../settings/server';
import { MentionsParser } from '../../mentions/lib/MentionsParser';
import { getUserAvatarURL } from '../../utils/lib/getUserAvatarURL';
Expand Down
Loading

0 comments on commit eca8100

Please sign in to comment.