Skip to content

Commit

Permalink
Added option to let user control the paged param (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed May 19, 2020
1 parent d94e5b0 commit 059ff06
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/app/tabs/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ <h3 class="card-header">{{'directory' | i18n}}</h3>
<label class="form-check-label" for="ad">{{'ldapAd' | i18n}}</label>
</div>
</div>
<div class="form-group" *ngIf="!ldap.ad">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="pagedSearch"
[(ngModel)]="ldap.pagedSearch" name="PagedSearch">
<label class="form-check-label"
for="pagedSearch">{{'ldapPagedResults' | i18n}}</label>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="ldapEncrypted" [(ngModel)]="ldap.ssl"
Expand Down
3 changes: 3 additions & 0 deletions src/app/tabs/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export class SettingsComponent implements OnInit, OnDestroy {

async submit() {
ConnectorUtils.adjustConfigForSave(this.ldap, this.sync);
if (this.ldap != null && this.ldap.ad) {
this.ldap.pagedSearch = true;
}
await this.configurationService.saveOrganizationId(this.organizationId);
await this.configurationService.saveDirectoryType(this.directory);
await this.configurationService.saveDirectory(DirectoryType.Ldap, this.ldap);
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@
"ldapAd": {
"message": "This server uses Active Directory"
},
"ldapPagedResults": {
"message": "This server pages search results"
},
"select": {
"message": "Select"
},
Expand Down
1 change: 1 addition & 0 deletions src/models/ldapConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export class LdapConfiguration {
username: string;
password: string;
ad = true;
pagedSearch = true;
}
2 changes: 1 addition & 1 deletion src/services/ldap-directory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class LdapDirectoryService implements DirectoryService {
const options: ldap.SearchOptions = {
filter: filter,
scope: 'sub',
paged: false,
paged: this.dirConfig.pagedSearch,
};
const entries: T[] = [];
return new Promise<T[]>((resolve, reject) => {
Expand Down

0 comments on commit 059ff06

Please sign in to comment.