mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-17 16:53:25 +00:00
bitwise check for account disabled
This commit is contained in:
@@ -12,6 +12,8 @@ import { DirectoryService } from './directory.service';
|
|||||||
|
|
||||||
import { LogService } from 'jslib/abstractions/log.service';
|
import { LogService } from 'jslib/abstractions/log.service';
|
||||||
|
|
||||||
|
const UserControlAccountDisabled = 2;
|
||||||
|
|
||||||
export class LdapDirectoryService implements DirectoryService {
|
export class LdapDirectoryService implements DirectoryService {
|
||||||
private client: ldap.Client;
|
private client: ldap.Client;
|
||||||
private dirConfig: LdapConfiguration;
|
private dirConfig: LdapConfiguration;
|
||||||
@@ -261,12 +263,15 @@ export class LdapDirectoryService implements DirectoryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private entryDisabled(searchEntry: any): boolean {
|
private entryDisabled(searchEntry: any): boolean {
|
||||||
const control = this.getAttr(searchEntry, 'userAccountControl');
|
const c = this.getAttr(searchEntry, 'userAccountControl');
|
||||||
if (control == null) {
|
if (c != null) {
|
||||||
return false;
|
try {
|
||||||
|
const control = parseInt(c, null);
|
||||||
|
// tslint:disable-next-line
|
||||||
|
return (control & UserControlAccountDisabled) === UserControlAccountDisabled;
|
||||||
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user