The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/lib/ldap/getLDAPConditionalSetting.ts

9 lines
440 B

import type { SettingValue } from '@rocket.chat/core-typings';
import { settings } from '../../../app/settings/server';
export function getLDAPConditionalSetting<T extends SettingValue = SettingValue>(settingName: string): T | undefined {
const isActiveDirectory = settings.get<string>('LDAP_Server_Type') === 'ad';
const key = isActiveDirectory ? settingName.replace('LDAP_', 'LDAP_AD_') : settingName;
return settings.get<T>(key);
}