mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-10 05:13:17 +00:00
conditional settings for ldap ad
This commit is contained in:
@@ -100,10 +100,18 @@
|
||||
<label for="interval">{{'interval' | i18n}}</label>
|
||||
<input type="number" min="5" class="form-control" id="interval" name="Interval" [(ngModel)]="sync.interval" placeholder="{{'ex' | i18n}} 5">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
||||
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="memberAttribute">{{'memberAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="memberAttribute" name="MemberAttribute" [(ngModel)]="sync.memberAttribute" placeholder="{{'ex' | i18n}} member">
|
||||
</div>
|
||||
<div [hidden]="ldap.ad">
|
||||
<div class="form-group">
|
||||
<label for="creationDateAttribute">{{'creationDateAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="creationDateAttribute" name="CreationDateAttribute" [(ngModel)]="sync.creationDateAttribute"
|
||||
@@ -114,11 +122,6 @@
|
||||
<input type="text" class="form-control" id="revisionDateAttribute" name="RevisionDateAttribute" [(ngModel)]="sync.revisionDateAttribute"
|
||||
placeholder="{{'ex' | i18n}} whenChanged">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
||||
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@@ -128,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!sync.useEmailPrefixSuffix">
|
||||
<div class="form-group">
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="emailPrefixAttribute">{{'emailPrefixAttribute' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="emailPrefixAttribute" name="EmailPrefixAttribute" [(ngModel)]="sync.emailPrefixAttribute"
|
||||
placeholder="{{'ex' | i18n}} sAMAccountName">
|
||||
@@ -138,6 +141,7 @@
|
||||
<input type="text" class="form-control" id="emailSuffix" name="EmailSuffix" [(ngModel)]="sync.emailSuffix" placeholder="{{'ex' | i18n}} @company.com">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
@@ -150,11 +154,12 @@
|
||||
<label for="userFilter">{{'userFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="userFilter" name="UserFilter" [(ngModel)]="sync.userFilter" placeholder="{{'ex' | i18n}} (&(objectClass=user))"></textarea>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass" placeholder="{{'ex' | i18n}} user">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="userPath">{{'userPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath" placeholder="{{'ex' | i18n}} CN=Users">
|
||||
</div>
|
||||
@@ -164,6 +169,7 @@
|
||||
placeholder="{{'ex' | i18n}} mail">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
@@ -176,12 +182,13 @@
|
||||
<label for="groupFilter">{{'groupFilter' | i18n}}</label>
|
||||
<textarea class="form-control" id="groupFilter" name="GroupFilter" [(ngModel)]="sync.groupFilter" placeholder="{{'ex' | i18n}} (&(objectClass=group))"></textarea>
|
||||
</div>
|
||||
<div [hidden]="directory != directoryType.Ldap">
|
||||
<div class="form-group">
|
||||
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass"
|
||||
placeholder="{{'ex' | i18n}} group">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group" [hidden]="ldap.ad">
|
||||
<label for="groupPath">{{'groupPath' | i18n}}</label>
|
||||
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath" placeholder="{{'ex' | i18n}} CN=Groups">
|
||||
</div>
|
||||
@@ -195,6 +202,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button appBlurClick type="submit" class="btn btn-primary">
|
||||
<i class="fa fa-save fa-fw"></i>
|
||||
{{'save' | i18n}}
|
||||
|
||||
@@ -56,6 +56,14 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
async submit() {
|
||||
if (this.ldap.ad) {
|
||||
this.sync.creationDateAttribute = 'whenCreated';
|
||||
this.sync.revisionDateAttribute = 'whenChanged';
|
||||
this.sync.emailPrefixAttribute = 'sAMAccountName';
|
||||
this.sync.groupPath = 'CN=Users';
|
||||
this.sync.userPath = 'CN=Users';
|
||||
}
|
||||
|
||||
await this.configurationService.saveDirectoryType(this.directory);
|
||||
await this.configurationService.saveDirectory(DirectoryType.Ldap, this.ldap);
|
||||
await this.configurationService.saveDirectory(DirectoryType.GSuite, this.gsuite);
|
||||
|
||||
@@ -321,9 +321,6 @@
|
||||
"password": {
|
||||
"message": "Password"
|
||||
},
|
||||
"thisIsActiveDirectory": {
|
||||
"message": "This is an Active Directory LDAP server."
|
||||
},
|
||||
"type": {
|
||||
"message": "Type"
|
||||
},
|
||||
@@ -331,7 +328,7 @@
|
||||
"message": "Directory"
|
||||
},
|
||||
"currentUser": {
|
||||
"message": "Authenticate as current user"
|
||||
"message": "Authenticate as current system user"
|
||||
},
|
||||
"rootPath": {
|
||||
"message": "Root Path"
|
||||
@@ -364,7 +361,7 @@
|
||||
"message": "Interval (in minutes)"
|
||||
},
|
||||
"removeDisabled": {
|
||||
"message": "Remove disabled users"
|
||||
"message": "Remove disabled users during sync"
|
||||
},
|
||||
"memberAttribute": {
|
||||
"message": "Member Attribute"
|
||||
@@ -376,7 +373,7 @@
|
||||
"message": "Revision Date Attribute"
|
||||
},
|
||||
"useEmailPrefixSuffix": {
|
||||
"message": "Use email prefix/suffix"
|
||||
"message": "If a user has no email address, combine a username prefix with a suffix value to form an email"
|
||||
},
|
||||
"emailPrefixAttribute": {
|
||||
"message": "Email Prefix Attribute"
|
||||
@@ -418,10 +415,10 @@
|
||||
"message": "Sync"
|
||||
},
|
||||
"ldapSsl": {
|
||||
"message": "This connection uses SSL (LDAPS)"
|
||||
"message": "This server uses SSL (LDAPS)"
|
||||
},
|
||||
"ldapAd": {
|
||||
"message": "This LDAP server is Active Directory"
|
||||
"message": "This server uses Active Directory"
|
||||
},
|
||||
"select": {
|
||||
"message": "Select"
|
||||
|
||||
@@ -63,7 +63,7 @@ export class ConfigurationService {
|
||||
if (savedConfig.privateKey == null) {
|
||||
await this.secureStorageService.remove(Keys.gsuite);
|
||||
} else {
|
||||
(config as any).privateKey = savedConfig.privateKey =
|
||||
(config as GSuiteConfiguration).privateKey = savedConfig.privateKey =
|
||||
savedConfig.privateKey.replace(/\\n/g, '\n');
|
||||
await this.secureStorageService.save(Keys.gsuite, savedConfig.privateKey);
|
||||
savedConfig.privateKey = StoredSecurely;
|
||||
|
||||
Reference in New Issue
Block a user