|
|
|
@ -114,9 +114,14 @@ export class LDAPEEManager extends LDAPManager { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static async advancedSyncForUser(ldap: LDAPConnection, user: IUser, isNewRecord: boolean, dn: string): Promise<void> { |
|
|
|
|
try { |
|
|
|
|
await this.syncUserRoles(ldap, user, dn); |
|
|
|
|
await this.syncUserChannels(ldap, user, dn); |
|
|
|
|
await this.syncUserTeams(ldap, user, dn, isNewRecord); |
|
|
|
|
} catch (e) { |
|
|
|
|
logger.debug(`Advanced Sync failed for user: ${dn}`); |
|
|
|
|
logger.error(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static async advancedSync( |
|
|
|
@ -312,6 +317,7 @@ export class LDAPEEManager extends LDAPManager { |
|
|
|
|
|
|
|
|
|
const channels: Array<string> = [].concat(fieldMap[ldapField]); |
|
|
|
|
for await (const channel of channels) { |
|
|
|
|
try { |
|
|
|
|
const room: IRoom | undefined = Rooms.findOneByNonValidatedName(channel) || this.createRoomForSync(channel); |
|
|
|
|
if (!room) { |
|
|
|
|
return; |
|
|
|
@ -330,6 +336,10 @@ export class LDAPEEManager extends LDAPManager { |
|
|
|
|
removeUserFromRoom(room._id, user); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
logger.debug(`Failed to sync user room, user = ${username}, channel = ${channel}`); |
|
|
|
|
logger.error(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|